I have a tool that plays an animation when clicked and some other stuff, here is the code:
--Script(Server)
local tool=nil
local char=nil
local effect=nil
script.Parent.Activated:Connect(function()
tool=script.Parent
char=tool.Parent
local id=tool.animParent.Animation
local anim=char.Humanoid:LoadAnimation(id)
wait()
game.Workspace.GearSecond.Playing=true
effect=Instance.new("Smoke",char.HumanoidRootPart)
effect.RiseVelocity=0.2
effect.Size=0.1
char.Humanoid.WalkSpeed=50
anim:Play()
end)
script.Parent.Unequipped:Connect(function()
effect:Destroy()
char.Humanoid.WalkSpeed=16
end)
keep in mind this works the exact way I want it to in studio, the player clicks the tool the animation plays the sound plays and they get the effect, and when they unequip the tool the effect disappears. But I published the update to the game and the animation doesn't play I am wondering if this has something to do with the fact that the game is on team create but I am not sure.Or do I have to use a local script or a Remote Event for Animations? If this helps the script is inside a tool with an animationcontroller and animation inside, looks like this:
v Tool Script v Animation Controller Animation

4 comments
Did you publish it? (the place)
Yes
Is the animation created by you or your group (if it's a group game)?
the animation is created by me