this is the lines where the script don't work. It works perfect in studio but not in game. The tools in StarterGear won't be destroyed even if "keepAfterRe" is false.
local items = player.StarterGear:GetChildren()
for i = 1, #items do
if items[i].keepAfterRe.Value == false then
items[i]:Destroy()
end
end
local char = player.Character
local h = char:FindFirstChild("Humanoid")
h.Health = 0

2 comments
well... it was my bad, I accidentally looped it. Thanks for your reply, but for your sake, I'll accept answer.
Thanks!