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.

4 comments
I was just wondering: why is this in a local script?
its in a gui button i think
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"
Learned remote events, some more scripting, and now it works flawlessly. Thanks!