Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why Won't This Animation Play For Everyone?

Asked by 5 years ago

It may be that it's in a local script, but the following lines should play a custom animation I made. It works for me, but none of my friends see the animation. Any ideas why?

local animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
animation:Play()

2 answers

Log in to vote
1
Answered by
Arkrei 389 Moderation Voter
5 years ago

Make sure the animation is in YOUR inventory. Also if the game is a group game make sure the group owner has the animation in their inventory. I had this problem a while back and It happened to be that the animation was in the group inventory which only displayed the animation for people who are in the group

0
So if the animation is in my game as well as my inventory, anyone who plays the game will be able to see it? corncob567 275 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

Consider this:

A localscript is client sided. Meaning it runs on your device. All games default to Filtering Enabled to reduce the exploiters making on the news, as such we have two sides, Server sided and client sided. Server sided scripts (or just a regular script.) uses code visible towards everyone. Difference being that the client sided events can't be activated to trigger events from players, like pressing a key, because it stays at the client sided. If you want to play an animation for everyone to see, transfer your code to a regular script, but if you need to trigger events from the client to end up in the server, use Remote Events and/or remote functions.

https://developer.roblox.com/articles/Remote-Functions-and-Events

Answer this question