You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
for the other players to see the animation, when in use, and for the animation to stop playing when its unequipped -
What is the issue? Include screenshots / videos if possible!
well currently, it will continue to play the loop of the player doing the animation, but when it unequips it still shows the animation playing for other players -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve been looking for a while to see if their is any reason or solution to why its doing it, I’ve looked on google and here
local tool = script.Parent
local IdleAnim = Instance.new("Animation")
IdleAnim.AnimationId = "rbxassetid://8701900022"
local firstTrack
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://8701693781"
local track
local plr = game.Players.LocalPlayer
local player = tool.Parent:IsA("Model") and game.Players:GetPlayerFromCharacter(tool.Parent) or tool.Parent.Parent
local char = player.Character or player.CharacterAdded:Wait()
local humR = char:WaitForChild("HumanoidRootPart")
local Debounce = false
tool.Equipped:Connect(function()
firstTrack = script.Parent.Parent.Humanoid:LoadAnimation(IdleAnim)
firstTrack.Priority = Enum.AnimationPriority.Action
firstTrack:Play()
humR.Anchored = true
wait(1)
end)
tool.Activated:Connect(function()
track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
track.Priority = Enum.AnimationPriority.Action
if Debounce == false then
Debounce = true
track:Play()
wait(1.2)
track:Stop()
wait(0.1)
Debounce = false
end
end)
tool.Unequipped:Connect(function()
if firstTrack then
firstTrack:Stop()
humR.Anchored = false
end
end)
tool.Unequipped:Connect(function()
if track then
track:Stop()
track:Destroy()
end
end)