Hello,
Currently I am trying to write a script that removes a player’s BoolValues when they die. It doesn’t work, however there don’t seem to be any errors in the Output.
The script (ServerScript in ServerScriptService):
game.Players.PlayerAdded:Connect(function(player)
player:WaitForChild('Humanoid').Died:Connect(function()
local descendants = game.Players:GetDescendants()
for i,v in pairs(descendants) do
if v:IsA("BoolValue") then
v:Destroy()
print("BoolValues destroyed")
end
end
end)
end)
Thank you for your help!