Lose Money
Die
Die
game:GetService('Players').PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
if player.leaderstats.Money.Value - 50 >= 0 then
player.leaderstats.Money.Value -= 50
player.PlayerGui.Death.Message.Visible = true
player.PlayerGui.Death.Message.Text = '-50 Money'
wait(1)
player.PlayerGui.Death.Message.Visible = false
end
end)
end)
end)
Leaderboard
Leaderboard
local function onPlayerJoin(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local money = Instance.new("IntValue")
money.Name = "Money"
money.Value = 50
money.Parent = leaderstats
end
game.Players.PlayerAdded:Connect(onPlayerJoin)