I’ve been trying to write a horse speed changing system forever now, and I can get the horse to walk around, but can’t actually change speed. If you could provide me some pointers or move me in the right direction, it’ll be greatly appreciated!
UserInputService.InputBegan:Connect(function(input)
if input == Enum.KeyCode.LeftShift then
print("galloping")
value = 'gallop'
cantering = false
elseif input == Enum.KeyCode.LeftControl then
value = 'walk'
print("walking")
cantering = false
end
end)
--server script
value.Changed:Connect(function(input)
if input == 'gallop' then
print("galloping")
gallop()
elseif input == 'canter' then
print("cantering")
canter()
elseif input == 'walk' then
print("walking")
walk()
end
end)
note, i’ve tried remote events in replicated storage or in the horse, neither worked and this is just values that don’t work either
the value is not replicating to the server you need to modify it there, you can use remote events, but you said that you already used it so can you explain how you used them?
i had used a local script that sent out a text specifying which mode the horse should switch to, and the server sided script had responded by doing said action by doing the local function corresponding to it.
-- local
RemoteEvent:FireServer("Gallop")
-- server
RemoteEvent.OnServerEvent:Connect(function(moveType)
if moveType == "Gallop" then
gallop()
elseif moveType == "Canter" then
canter()
end
end)```
and so on