Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how do i make a leaderboard with kick script?

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

local Counter = "Deaths"

game.Players.PlayerAdded:connect(function(Player)
	local leaderstats = Player:FindFirstChild('leaderstats') or Instance.new("Folder", Player)
	leaderstats.Name = "leaderstats"
	
	local deaths = leaderstats:FindFirstChild(Counter) or Instance.new("IntValue", leaderstats)
	deaths.Name = Counter
	deaths.Value = 0
	
	Player.CharacterAdded:connect(function(Character)
		local d = true
		Character:WaitForChild("Humanoid").Died:connect(function()
			if (d) then
				d = false
				deaths.Value = deaths.Value + 1
			end
		end)
	end)
end)

help

1 answer

To kick try this:

if deaths.Value >= 5 then
	Player:Kick("You have died too many times!")
end

3 comments

0

where im supposed to put that?

0

Try after the line "deaths.Value = deaths.Value + 1"

0

it doesnt kicks me

This discussion is preserved as it was. New answers, comments, and votes are closed.