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

Animation does not play in clone npc?

Asked by 5 years ago
Edited 5 years ago

Hello i'm making a Shooting game and a script that makes for every player a new npc that only they can see and a animation must play in the npc but that is not the problem the problem is that the animation does not want to play in the clone but the non cloned npc does the animation i don't under stand

Here is the script


wait(4) local hum = script.Parent.Humanoid local anim = hum:LoadAnimation(script.Parent.cheeto) repeat anim:Play() wait(2) until true == false

here is where the script is

Script : in the npc and it is a normal script

NPC: Game.Workspace

help?

0
don't use local script. change it to normal script OnaKat 444 — 5y
0
Why are you using OfClass? Freddan2006YT 88 — 5y
0
And are you getting an error code? What i think it is that it it's not actually accsessing the animation. Freddan2006YT 88 — 5y
0
I just change the help thing read it now please help i have to do this so i can go on with my game GamerJanko 50 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Make sure it is a server-side script. Assuming that NPC is in workspace and the Animation is in the script.

wait(4)
local humanoid = script.Parent.Humanoid

local anim = humanoid:LoadAnimation(script.AnimationName)
anim:Play()
wait(2)
anim:Stop()
0
Sorry it still dont work and the normal npc does not do the animation as well so yea and please remeber that i made it so only 1 player can see the npc GamerJanko 50 — 5y
0
Then use a remote event to play the humanoid's animation from the player's client. ScaleisRed 58 — 5y
Ad

Answer this question