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

Humanoid.WalkSpeed not changing on a horse?

Asked by 2 years ago

I have a horse and I would like to be able to change its speed. It has a humanoid and the script I wrote is able to change the value of Humanoid.WalkSpeed but the horse shows no sign of slowing down or speeding up. It speeds up and slows down perfectly when not controlled by script. Am I doing something wrong? Code:

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function(plr)
    local currentseat = player.Character.Humanoid.SeatPart
    local hum = currentseat.Parent:WaitForChild("Humanoid")
    hum.WalkSpeed = 20
    print(hum.WalkSpeed)
end)

Thanks in advance, Scryptio.

0
I was just wondering: why is this in a local script? echobloxia 21 — 2y
0
its in a gui button i think Puppynniko 1059 — 2y
0
You need to make sure that it's a global script not a local script. I suggest learning how to do the basics of remote events. It's quite simple once you get the hang of It I promise. It's a lot to type here, I suggest searching YouTube for "Roblox simple Remote event tutorial" ElongatedMongoose 138 — 2y
0
Learned remote events, some more scripting, and now it works flawlessly. Thanks! Scryptio 64 — 2y

Answer this question