I'm wondering how can I make a local script change the BoolValue and have the server read it. Currently I have this Crouching script that works playing the animation to everyone else, however the value stay the same (false). How do I fix this?
Player = game.Players.LocalPlayer
repeat
wait()
until Player.Character
Mouser = Player:GetMouse()
name = Player.Name
char = game.Workspace[Player.Name]
Animation = script.Anim
animtrack = char.Humanoid:LoadAnimation(Animation)
Mouser.KeyDown:connect(function(key)
if string.byte(key) == 48 then
animtrack:Play()
Player:FindFirstChild("Crouch").Value = true
char.Humanoid.WalkSpeed = 8
end
end)
Mouser.KeyUp:connect(function(key)
if string.byte(key) == 48 then
script.Disabled = true
animtrack:Stop()
Player:FindFirstChild("Crouch").Value = false
char.Humanoid.WalkSpeed = 16
script.Disabled = false
end
end)

1 comment
also, use UserInputService.InputBegan instead of Mouse.KeyDown