Is there a way to play my animation for only the player?
I'm making a crouch script and it works fine for one player but if you have more, then any player can control the newest joined player. The animation will play only for this new player and nobody else.
This is my script under ServerScriptService:
01 | local walking = Instance.new( "BoolValue" ) |
03 | local Players = game:GetService( "Players" ) |
06 | Players.PlayerAdded:Connect( function (player) |
09 | local Animation = Instance.new( "Animation" , player.Character) |
11 | Animate = player.Character.Humanoid:LoadAnimation(Animation) |
14 | local Animation 2 = Instance.new( "Animation" , player.Character) |
15 | Animation 2. Name = "Animation2" |
17 | Animate 2 = player.Character.Humanoid:LoadAnimation(Animation 2 ) |
23 | game.ReplicatedStorage.Crouch.Start.OnServerEvent:Connect( function (player) |
24 | if walking.Value = = false then |
32 | game.ReplicatedStorage.Crouch.End.OnServerEvent:Connect( function (player) |
40 | game.ReplicatedStorage.Crouch.Start.OnServerEvent:Connect( function (player) |
41 | player.Character.Humanoid.Running:Connect( function (speed) |
42 | if walking.Value = = true and speed > = 1 then |
51 | game.ReplicatedStorage.Crouch.Start.OnServerEvent:Connect( function (player) |
52 | player.Character.Humanoid.Running:Connect( function (speed) |
53 | if speed < = 0 and walking.Value = = true then |
Instead of Animate:Play() or Animate:Stop() using my created animations is there a way to do
1 | player.Character.Animate:Play() |
I've just recently got into animations so any help is appreciated.