GUI Local Script Dont work after Chrackter Died

it works fine until i died after that the printings has stopped and no errors shows

hey, to make the localscript work after Chrackter Died you must remove the game.Players.PlayerAdded:Wait() on the first line of the script because it will keep waiting until a player has joined the game

2 Likes

i removed it but nothink changed :frowning:

what did you remove exactly, give me the first edited line

local player = game.Players.LocalPlayer

thats my first line

does the output print anything such as “infinite yield possible on waitforchild”

yes your right there is
Infinite yield possible on ‘Players.TapsoNNN:WaitForChild(“Lv”)’
you know how to fix it?

if its searching for “Lv” that means its a server issue

so how do i fix this do you have any ideas?

WaitForChild means it’s waiting/yielding for something to be added into that parent with the name given.

You can fix that by adding Lv into player, and if you’re positive that thing is being added it’s possible there was a spell error.

i mean lv is arleady in leaderstats in the player but how is it possible that at the first time it can be found and if player dies there is no lv anymore?

you said it, because it’s in leaderstats
it’s searching in the player

1 Like

i changed it and now if i dies it works but at joining the game it dont show the values :confused:
same problem but diffrent ways i am confussed

The problem was that the values did not updated after player died, so i change this line
local level = player:WaitForChild(“Lv”)
to this
local level = player.leaderstats:WaitForChild(“Lv”)
and now the values do not get updated befor the player dies

Can anybody explain this? :frowning:

i solved this problem by adding
wait(1) befor
local level = player.leaderstats:WaitForChild(“Lv”)