alright so in my game this is my levelup handler which when someone levels up it is supposed to clone a gui into their PlayerGui which it does fine the first time but after they level up again nothing, i have no idea why it would just quit after one clone
script:
game.Players.PlayerAdded:Connect(function(player)
local requirements = player:WaitForChild("Requirements")
local levelrequirement = requirements.RequiredKills
local leaderstats = player.leaderstats
local kills = leaderstats.Kills
local level = leaderstats.Level
local levelupgui = game.ServerStorage.LevelUp:Clone()
kills.Changed:Connect(function()
if kills.Value >= levelrequirement.Value then
print(player.Name.." Leveled Up")
level.Value = level.Value + 1
levelupgui.Parent = player.PlayerGui
wait(5)
levelupgui:Destroy()
if level.Value >= 5 then
levelrequirement.Value = levelrequirement.Value + 20
else
levelrequirement.Value = levelrequirement.Value + 15
end
end
end)
end)

4 comments
Try directly referencing the levelupgui through playergui instead of how you're doing it here. Or when it happens, check ingame and see if the gui is still in server storage.
it was still in the server storage so ill try directly referencing it but since the server cant see a clients PlayerGui idk if that will work but i will try it
ok no that did not work
yeah if it was still in storage no point. worth a shot. \