Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is my script only working in studio and not on public servers?

This script is only working in studio. I am trying to make a gui button play an animation

Player = game.Players.LocalPlayer
local Animation = Instance.new("Animation")
Animation.AnimationId = "http://www.roblox.com/asset?id=501371142"

function PlayAnimation()
local animTrack = Player.Character.Humanoid:LoadAnimation(Animation)
animTrack:Play()
end
script.Parent.MouseButton1Down:connect(PlayAnimation)


2 answers

What type of animation is it? If it is R15 or R6 go to your game settings and only allow the type your doing. I think this will work becuase I had that same problem.

For example all my animations are for R6 so it wont work fro R15 so I have to go to game setting and change it so it only allows R6. And people with R15 mode will become R6.

It could be what PhotonLightning suggested, however if you play on a public server you can press CTRL + F9 in order to check any errors that have occured. Remember this, it can help you out a lot in the future.

Sometimes Studio just doesn't seem to want to show you all of the errors.

5 comments

1

If it is what Photon said, how do I make it only R6. Here is a link to the error. https://gyazo.com/7a9e941026745942e55fa6ba39b81e79

0

The error means the AnimationId isn't trusted, or doesn't actually exist.

0

Exactly. You can only use Animations made by Roblox or yourself. You can't use other people's animations or it will give you that exact error.

0

So should I try making a new animation because the one in the script is mine.

0

Probably... Sorry that I couldn't help further dude.

This discussion is preserved as it was. New answers, comments, and votes are closed.