The Local Script:
script.Parent.Activated:Connect(function() script.Parent.RemoteEvent:FireServer() end)
The Server Script:
script.Parent.RemoteEvent.OnServerEvent:Connect(function(Player) local Animation = script.Parent.Animation local animationTrack = Player.Character.Humanoid:LoadAnimation(Animation) animationTrack:Play() local Tool = script.Parent Tool.GripForward = Vector3.new(0.989, -0.151, -0.009) Tool.GripPos = Vector3.new(-0.566, -1.024, 0.181) Tool.GripRight = Vector3.new(0.151, 0.987, 0.059) Tool.GripUp = Vector3.new(0, 0.06, -0.998) wait(1.2) animationTrack.Stopped:Connect(function() Tool.GripForward = Vector3.new(0.989, 0, -0.151) Tool.GripPos = Vector3.new(-0.566, -0.588, 0) Tool.GripRight = Vector3.new(0.151, 0, 0.989) Tool.GripUp = Vector3.new(0, 1, 0) end) end)
I wanted it to have a 2-second cooldown but I have tried debounce and other ways from YouTube and I am lost how to add a cooldown to this. Thanks for the help.
adding a wait after firing the remote
do wait(your time to want to wait till the script under is activated)