Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i make a leaderboard with kick script?

Asked by 5 years ago

i want to do dis but idk how

when u die u get 1 death

if u get 5 deaths u get kick

also im ussing this script as leaderboard script

01local Counter = "Deaths"
02 
03game.Players.PlayerAdded:connect(function(Player)
04    local leaderstats = Player:FindFirstChild('leaderstats') or Instance.new("Folder", Player)
05    leaderstats.Name = "leaderstats"
06 
07    local deaths = leaderstats:FindFirstChild(Counter) or Instance.new("IntValue", leaderstats)
08    deaths.Name = Counter
09    deaths.Value = 0
10 
11    Player.CharacterAdded:connect(function(Character)
12        local d = true
13        Character:WaitForChild("Humanoid").Died:connect(function()
14            if (d) then
15                d = false
16                deaths.Value = deaths.Value + 1
17            end
18        end)
19    end)
20end)

help

1 answer

Log in to vote
0
Answered by 5 years ago

To kick try this:

1if deaths.Value >= 5 then
2    Player:Kick("You have died too many times!")
3end
0
where im supposed to put that? densomenso999 11 — 5y
0
Try after the line "deaths.Value = deaths.Value + 1" IProgram_CPlusPlus 58 — 5y
0
it doesnt kicks me densomenso999 11 — 5y
Ad

Answer this question