Hello guys i use this script every time for animating in my game to play animations but when there are 2 people in the server the animations play 2 times
Is there a way to fix that
Basically if there are two players in the server the animation plays two times
If Im alone it works normally
The Code:
Animation = Instance.new("Animation")
Animation.Parent = game.Workspace
Animation.AnimationId = "http://www.roblox.com/asset/?id=538445969"
local Player = game.Players.LocalPlayer
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.KeyDown:connect(function (key)
for i, v in pairs(game.Players:GetChildren()) do--i think its because of the GetChildren but then how do i fix that?
if key == "f" then
local AnimationTrack = Player.Character.Humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
end
end
end)
Please tell me what makes it duplicate :/

3 comments
Ok so what do i do to fix it?
I edited my answer so try that
Please give explanations on your answers, so that the OP can understand your answer.