Im trying to make a script that sets a BoolValue to True but i dont know how to do that! Please Help!
game.Players.PlayerAdded:connect(function(player) local leaderstats = Instance.new("Model", player) leaderstats.Name = "leaderstats" local wins = Instance.new("IntValue", leaderstats) wins.Name = "Wins" wins.Value = 0 local dead = Instance.new("BoolValue", player) dead.Name = "Died" dead.Value = false end) while wait(120) do for _,Player in pairs(game.Players:GetPlayers()) do if Player.Died.Value == false then Player.leaderstats.Wins.Value = Player.leaderstats.Wins.Value +1 else game.Players.Player.Died.Value = false end end end local player = game.Players.LocalPlayer game.Workspace.player.Humanoid.Changed:connect(function() if game.Workspace.player.Humanoid.Health == 0 then Player.Died.Value = true end end)
Died()
is an event :P
Check this
player = game.Players.LocalPlayer.Name game.Workspace.player.Humanoid.Changed:connect(function() if game.Workspace.player.Humanoid.Health == 0 then boolvalue = true end end)
Something like this I believe.