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
Roblox has added a new feature called drafts in roblox studio, you need to publish your scripts now. You don't need to publish your scripts to work in roblox studio. To turn it on its under the view tab in roblox studio