As the title says i have tried implementing characteradded into a localscript but it doesn’t fire. Is it a event that only fires on server scripts?
where are you using it? it’s not server-side only.
Where is the local script located?
If its in the StarterCharacterScripts then it wont work, it might work on StarterGui and StarteePlayerScripts also send your code.
its in the startergui, i only need it to work once the player has died, and respawned. I am aware that it might not work when the player originally joins due to the character already being in the game by the time the script has been ran.
Weird that it doesnt work, try
local character = plr.Character or plr.CharacterAdded:Wait()
i can use that for the first character but if the character dies i can’t retrieve the current character
You have a few options,
Either do something like what @OctaLua mentioned (in startergui with a gui that has ResetOnSpawnEnabled or StarterCharacterScripts) or in Option2 do :
local player = game:GetService("Players").LocalPlayer
player.CharacterAdded:Connect(function(character)
-- stuff here
end)
Simply, if you want to have the character again, do:
Humanoid.Died:Connect(function()
Character = player.Character or player.CharacterAdded:Wait()
end)
It can, but I know exactly what your problem is.
You have something that yeilds or waits BEFORE the CharacterAdded
event is assigned. You may notice it fires after your respawn if that’s the case.