#Disable wasd

15 messages · Page 1 of 1 (latest)

cunning warren
#

Please help me

timber nexus
#

no

#

make walkspeed 0

cunning warren
lusty emberBOT
#

studio** You are now Level 2! **studio

timber nexus
#
spark goblet
#
local function movePlayerToTarget(character, targetPosition)
    local humanoid = character:FindFirstChild("Humanoid")
    local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
    
    if humanoid and humanoidRootPart then
        humanoid.WalkSpeed = 0
        humanoid.JumpPower = 0
        humanoidRootPart.Anchored = true

        humanoid:MoveTo(targetPosition)

        humanoid.MoveToFinished:Wait()

        humanoid.WalkSpeed = 16
        humanoid.JumpPower = 50
        humanoidRootPart.Anchored = false
    end
end

script.Parent.Gate.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        if teleporting == false then
            local char = hit.Parent
            local player = game.Players:FindFirstChild(char.Name)
            local alreadyExists = false

            for i=1,#list do
                if list[i] == char.Name then
                    alreadyExists = true
                end
            end

            if alreadyExists == false then
                if #list < 2 then
                    table.insert(list, char.Name)
                    movePlayerToTarget(char, spawnTeleport.Position)
                    updateGui()
                    leaveGuiEvent:FireClient(player)
                end

                player.CharacterRemoving:Connect(function(character)
                    removeFromList(character)
                end)
            end
        end
    end
end)
cunning warren
#

like im stuck

spark goblet
#

Ohh

#

uhm

#

I'll try figure it out

#

like after?

#

or before?

#

This might work

local function movePlayerToTarget(character, targetPosition)
    local humanoid = character:FindFirstChild("Humanoid")
    local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
    
    if humanoid and humanoidRootPart then
        -- Disable movement
        humanoid.WalkSpeed = 0
        humanoid.JumpPower = 0
        humanoidRootPart.Anchored = true

        -- Move the player
        humanoid:MoveTo(targetPosition)

        -- Wait until the player reaches the target
        humanoid.MoveToFinished:Wait()

        -- Restore movement
        humanoid.WalkSpeed = 16
        humanoid.JumpPower = 50
        humanoidRootPart.Anchored = false
    end
end

script.Parent.Gate.Touched:Connect(function(hit)
    local char = hit.Parent
    if char:FindFirstChild("Humanoid") and not teleporting then
        local player = game.Players:FindFirstChild(char.Name)

        if player and not table.find(list, char.Name) then
            if #list < 2 then
                table.insert(list, char.Name)
                movePlayerToTarget(char, spawnTeleport.Position)
                updateGui()
                leaveGuiEvent:FireClient(player)
            end

            player.CharacterRemoving:Connect(function(character)
                removeFromList(character)
            end)
        end
    end
end)