addHook("ThinkFrame", do
	for player in players.iterate
        if player.mo == nil then continue end
        if player.mo.skin ~= "demo2kte" then -- change this <--
            continue
        end
		if (player.mo.state == S_PLAY_GLIDE or player.mo.state == S_PLAY_SWIM)
			if (player.powers[pw_super])
				P_InstaThrust(player.mo, player.mo.angle, FixedMul(28*FRACUNIT + player.glidetime * FRACUNIT/28, player.mo.scale))
			elseif (player.powers[pw_super]) and (player.mo.eflags & MFE_UNDERWATER)
				P_InstaThrust(player.mo, player.mo.angle, FixedMul(28*FRACUNIT + player.glidetime * FRACUNIT/42, player.mo.scale))
			elseif (player.mo.eflags & MFE_UNDERWATER)
				P_InstaThrust(player.mo, player.mo.angle, FixedMul(14*FRACUNIT + player.glidetime * FRACUNIT/42, player.mo.scale))
			else
				P_InstaThrust(player.mo, player.mo.angle, FixedMul(28*FRACUNIT + player.glidetime * FRACUNIT/42, player.mo.scale))
			end
			if (player.cmd.sidemove > 25)
				if (player.powers[pw_super])
					P_InstaThrust(player.mo, player.mo.angle - FixedAngle(30*FRACUNIT), FixedMul(42*FRACUNIT + player.glidetime * FRACUNIT/42, player.mo.scale))
				elseif (player.powers[pw_super]) and (player.mo.eflags & MFE_UNDERWATER)
					P_InstaThrust(player.mo, player.mo.angle - FixedAngle(30*FRACUNIT), FixedMul(28*FRACUNIT + player.glidetime * FRACUNIT/42, player.mo.scale))
				elseif (player.mo.eflags & MFE_UNDERWATER)
					P_InstaThrust(player.mo, player.mo.angle - FixedAngle(30*FRACUNIT), FixedMul(14*FRACUNIT + player.glidetime * FRACUNIT/42, player.mo.scale))
				else
					P_InstaThrust(player.mo, player.mo.angle - FixedAngle(30*FRACUNIT), FixedMul(26*FRACUNIT + player.glidetime * FRACUNIT/42, player.mo.scale))
				end
			end
			if (-player.cmd.sidemove > 25)
				if (player.powers[pw_super])
					P_InstaThrust(player.mo, player.mo.angle + FixedAngle(30*FRACUNIT), FixedMul(42*FRACUNIT + player.glidetime * FRACUNIT/42, player.mo.scale))
				elseif (player.powers[pw_super]) and (player.mo.eflags & MFE_UNDERWATER)
					P_InstaThrust(player.mo, player.mo.angle + FixedAngle(30*FRACUNIT), FixedMul(28*FRACUNIT + player.glidetime * FRACUNIT/42, player.mo.scale))
				elseif (player.mo.eflags & MFE_UNDERWATER)
					P_InstaThrust(player.mo, player.mo.angle + FixedAngle(30*FRACUNIT), FixedMul(14*FRACUNIT + player.glidetime * FRACUNIT/42, player.mo.scale))
				else
					P_InstaThrust(player.mo, player.mo.angle + FixedAngle(30*FRACUNIT), FixedMul(26*FRACUNIT + player.glidetime * FRACUNIT/42, player.mo.scale))
				end
			end 
			if player.glidetime > 1800
				player.glidetime = 1800
			end
		end 
		if (player.mo.state == S_PLAY_GLIDE_LANDING)
			S_StopSound(player.mo)
			P_ResetPlayer(player)
			S_StopSound(player.mo)
			player.mo.state = S_PLAY_WALK
		end
	end
end)

freeslot("S_PLAY_KNUXFALL")
states[S_PLAY_KNUXFALL] = {
	SPR_PLAY, SPR2_FALL, 2, nil, 0,  0, S_PLAY_KNUXFALL}

addHook("PlayerThink",function(p)
	if not (p.mo and p.mo.valid and p.mo.skin=="meknux")
		return end
	local mo = p.mo
	
	// No crouch
	if mo.state == S_PLAY_FALL
		mo.state = S_PLAY_KNUXFALL
		p.panim = PA_FALL
	end
	
	// This is required if you stop gliding
	//	very close to the ground.
	mo.prevmom = $==nil and {x=0,y=0,z=0} or $
	local pvm = mo.prevmom
	if mo.state != S_PLAY_GLIDE_LANDING
		pvm.x = mo.momx;	pvm.y = mo.momy;	pvm.z = mo.momz
	else
		mo.state = S_PLAY_WALK
		mo.momx = pvm.x;	mo.momy = pvm.y;	mo.momz = pvm.z
		p.pflags = $ & ~PF_STASIS
	end
	
	// No skid
	if P_IsObjectOnGround(mo) and p.pflags & PF_GLIDING
		p.pflags = $ & ~(PF_GLIDING|PF_JUMPED|PF_NOJUMPDAMAGE)
		p.mo.state = S_PLAY_WALK
	end
	p.skidtime = 0
end)
