Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How can one use MoveTo() w/Humanoid and not be interrupted by the player's controls?

Asked by 6 years ago
Edited 6 years ago

Eh... I am pretty sure this can be done. If not then I am doomed.

I have tried WalkToPoint() which essentially does the same thing as MoveTo() with a humanoid.

So I have tried using both, and they can both be interefered with the player's controls. WASD or Arrow Keys

I also have tried putting the player's WalkSpeed at 0 or a low level, but that disables the player to even walk at all.

Also here is what I have so far:

local debounce = true
local WalkTo = script.Parent.Parent.TriggerStop

script.Parent.Touched:Connect(function(plr)
    if plr.Parent:FindFirstChild("Humanoid") then
        if not debounce then
            return
        end
        debounce = false
        plr.Parent.Humanoid.WalkSpeed = 16
        plr.Parent.Humanoid:MoveTo(WalkTo.Position)
        wait(0.01)
        debounce = true
    end
end)

Any feedback is helpful!

0
One thing you could try is figure out how to temporarily "disable" the WASD keys so they can't interfere in your MoveTo() script. I'm not quite sure how you would achieve this but it's a start. EnderGamer358 79 — 6y
0
Good question, btw, don't use moveto, use CFrame on HRP (humanoidrootpart) instead User#20388 0 — 6y
0
I don't think it still works though, but you can try User#20388 0 — 6y
View all comments (3 more)
0
Okay I can probably try to use the disable controls, but wont CFrame just "teleport" me to the destination? I would like to see the walking MusicalDisplay 173 — 6y
0
Please see https://wiki.roblox.com/index.php?title=API:Enum/DevComputerMovementMode and https://wiki.roblox.com/index.php?title=API:Enum/DevTouchMovementMode for altering how players' controls move the character. Scriptable will disable all default movement controls. IPsec 35 — 6y
0
@IPsec yes this did disable the player's controls, It did not allow me to move my player to the required destination, much like setting the player's WalkSpeed and JumpPower to 0 MusicalDisplay 173 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

I have decided to use BodyVelocity because this would take me ages

If anybody happens to find the answer, contact me or write an answer..

Ad

Answer this question