#Script not letting npc do animation
140 messages · Page 1 of 1 (latest)
is the game from a group?
nope just myself
i have no clue what im really doing, i made an animation and thought "lemme try it ingame"
yes? why would it not its an animation
** You are now Level 1! **
like the position
i can send a short clip if thatll help
this was sent to other people b4 btw thats why its long
Oh
the problem here is probably because it doesnt repeat
i dont follow
yes
if i use the run option instead where its the camera it still doesnt do it
i dont know what game i want to exactly do yet, i wanted to play around with some things tonight though
i guess a fighting game if that helps thatd probably be inline with what id want
alright
is that helpful to you?
u didn't set the animation parent
set animation.Parent to Humanoid
one second lemme try that
also since the rig is an existing model, why clone if you can preload everything by just putting an animation folder inside of humanoid or something, and from there load the animation?
im not exactly sure what any of that means in all honesty i dont mean to be rude i just have no clue what you mean by putting an animation folder in the humanoid
I meant like instead of cloning and duplicating stuff just put an animation inside of the humanoid in studio and put the animationid there. from there you can get the animation and load it. easy peasy
Yeah you can load it.
Do
local anim = script.Animation
local animator = script.Parent.Humanoid.Animator
local track = animator:LoadAnimation(anim)
track:Play()
copy pasted that and hes not doing the animation
** You are now Level 2! **
Im gonna delay it so you can see
local anim = script.Animation
local animator = script.Parent.Humanoid.Animator
local track = animator:LoadAnimation(anim)
task.wait(4)
track:Play()
I mean you have to wait until the character loads that could be the reason
** You are now Level 5! **
Not the reason
without the delay he would just stand their
yeah thats what im saying
Pretty sure when he was loading the game loaded faster
how could the game load faster than a model that its in the game 😮
Networkship
you tell that
is their a way to loop the animation in code?
yeah animation.Looped = true
and what line would that go on?
below the track line
local anim = script.Animation
local animator = script.Parent.Humanoid.Animator
local track = animator:LoadAnimation(anim)
track.Looped = true
task.wait(4)
track:Play()
it only does the 1 with that
what
ye it only does it once for some reason
did u use this? @frail ibex
show me
through a recording or screenshare
recording
also, please use Gyazo lmfao instead of screen recording from a phone
or Medal / Geforce experience
i left 4 second space after the emote to see if it looped the wait line to and it still didnt
i just ran it without the task wait line and it wouldnt do it at all
did you publish the animation as looped though
same as you did when you pressed that refresh button looking thing
wait so that just has to be toggled on when i publish
toggle looping animation yes that and publish it
so, when i inserted the looped version ID, it yet again didnt play or loop, HOWEVER with the task.wait command it did forever loop
** You are now Level 3! **
so i do need the time to start it on it
that should be fixed now, Thank you so much for the help, if i can ask one more question however would i input the same code to make the player do the animation instead of the npc
nvm it did work
inputting that you should go with
local anim = script.Animation game.Players.PlayerAdded:Connect(function(plr)
local cloned = anim:Clone()
cloned.Parent = plr.Character.Humanoid
local animtrack = plr.Character.Humanoid.Animator:LoadAnimation(cloned)
animtrack:Play()
end)```
is that in a local script or normal script
ill use that instead to be on the safe side, dont want spaghetti coding lmao
that doesnt seem to work on either local or normal script
serverscript
serverscriptservice
can't get spoofed because its on server
where is that?
wait nvm
im blind
and thats a normal script inserted into serverscriptservice correct?
there is three type of scripts
modulescript (client and server (this is only for data)) (the colour of this script is purple)
localscript (client only - client PC viewable, ignored by engine if in server instances.) (the colour is blue.)
serverscript (access to all data in server, instances, and stuff, the brain of the game.) (colour is white.)
ok im following
when i go to insert a script to further insert the script youve given me i dont see a server script
i just told you the color is white
that means its a Script
in terms of short
OH right ok i get it now, sorry
that doesnt seem to do it ;_;
thats the full thing their, i added the animation and ID like before to it aswell
bro uh you need to press enter on the first line
between animation and game.Players
Format it
it didnt do it still
you should have the animation inside of the script
pardon?
same as this you see this pill animation put it in that script
Oh so copy intro dance to the serverscript
** You are now Level 4! **
still didnt work