I have this plush item that plays an idle animation (as seen in first picture) and it works perfectly fine when equipped/unequipped, however, after death it has a 50/50 chance to just not work and it looks like the fourth picture below. I'm not exactly sure what the problem is.
#Item idle animation quits working after death.
1 messages · Page 1 of 1 (latest)
use put the Character.CharacterAdded event wrapped arounf the tool.Equipped and tool.Unequipped event
excuse my stupid questions, but i am not the best scripter. could you let me know where to put that? again i'm so sorry for asking i'm a beginner scripter 🙏
its alr
i'm not familiar with that since i haven't used it yet
OH
tysm let me try that out (and also write it down so i don't forget to learn that)
alr
so game.Players.PlayerAdded is when a player joins the game
and
player.CharacterAdded is when a character is added (so when it spawns into the game) so it runs when it resets
game.Players.PlayerRemoving is when a player LEAVES the ga,e
now that you explain it
game*
i was familiar with player added but character added so that actually makes sense
mhm
if u run this is a server script
u need
to have
first
so then
u can access the player to make the player.CharacterAdded part
so its
does this look right
exactly
alright
if u want to add this feature as a local script
u can just make a local script under startercharacterscript
itll run whenever the player respawns
DONT USE THAT FOR NPCS, ONLY PLAYERS
oh yeah i might've forgot to mention that this was the local script sorry if my wording was confusing
ok
understood
ok i was just checking 👍
testing rn
alr
uh oh
can u add print statements for the tool.Equipped and tool.Unequipped?
also do one for
characteradded
mhm
yea it isnt printing the statement
that means it isnt running properly
here lets try this
remove all of the code
and replace it with ur original
this one
then
wait no
wait nvm
take the code
drag it under startercharacterscripts
and then
replace
Tool = script.Parent
with
wherever my tool is at right?
Tool = Player:WaitForChild("Backpack"):WaitForChild("KroyPlush")
yea
so the code should look like this (gimme one sec to type)
so it's in starterpack right now, but if i want it to be a purchasable item in the future, am i able to route it to the player's backpack?
Like since the local script and tool are seperated
local players = game:GetService("Players")
local plr = players.LocalPlayer
local backpack = plr:WaitForChild("Backpack")
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChildOfClass("Humanoid")
local animator = hum:WaitForChild("Animator")
local tool = backpack:WaitForChild("KroyPlush")
local idleAnim = script:WaitForChild("Idle")
local idleTrack = animator:LoadAnimation(idleAnim)
tool.Equipped:Connect:function()
idleTrack:Play()
end)
tool.Unequipped:Connect(function()
idleTrack:Stop()
end)```
oh shoot
remove the comment in the code
itll cause an error since its 2 lines lol
lol got it 👍
i would put it under serverstorage, and once u want to give it to the player, cloen it and put it into their backpack
clone*
oh shoot im late
replace WaitForChildOfClass to just WaitForChild
my fault, i got confused with the two
alr
I can't get it to break so yeah i think it worked!
gonna try with more players since i didn't even notice it happening til i played with like 4 people let me try that rq
so did it work?
@tacit ridge