function onCharacterDied(character)
end
function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid")
if humanoid then
humanoid.Died:Connect(function()
onCharacterDied(character)
end)
end
end
function onPlayerAdded(player)
if player then
player.CharacterAdded:Connect(onCharacterAdded)
end
end
game.Players.PlayerAdded:Connect(onPlayerAdded)
When the character dies they have a IntValue in them, how do I access it when they die I tried defining a variable but it didn’t exist because the character model got destroyed
EDIT: nvm for some reason it didn’t work before but I did the same thing and it worked, idk if roblox was trolling me like they usually seem to do but all I did was add local int = findfirstchild(the int value in character)