Hi! This is my first post on here. So, I've been trying to make a simple crouching system, and everything is fine, except for changing the walk speed. Here is the remoteevent script:

game.ReplicatedStorage.Crouch.OnServerEvent:Connect(function(plr, char)
	local animMake = Instance.new("Animation")
	animMake.Name = "Crch"
	animMake.Parent = char
	animMake.AnimationId = "rbxassetid://5109100398"
	local anim = char.Humanoid:LoadAnimation(animMake)
	anim:Play()
	char.Humanoid.WalkSpeed = 10
game.ReplicatedStorage.UnCrouch.OnServerEvent:Connect(function(plr, char)
anim:Stop()
char.Humanoid.WalkSpeed = 16
end)
end)

Please help me! I don't understand what would be causing this to happen.

6 comments

0

Can you show the localscript also?

0

Why? I'm not doing anything except for detecting if the player presses "C" and firing the the remotevents according to the variables I set up to check if the player is already crouching. The animations work just fine, and so does the toggling, once again it's just the walkspeed that is resetting whenever I change it.

0

(I'm getting the input and firing the remoteevents in the localscript, I forgot to add the localscript part.)

0

why don't you play both the animations and change walkSpeed via localScript? those are replicated from client

0

They are? I'm pretty sure you need to play animations and change a characters properties on a server-side script, in order for it to appear for everyone.

0

I was having the same problem and it seems as if it was caused by some free models. I was using the Roblox guns, so check if you have those.