I am Making an obby game but i need a leaderstats for showing the stage and a checkpoint script. Please help?!
✓ ANSWER ACCEPTED
Obby Checkpoint and Leaderstats?
1 answer
✓ Accepted answer
First start with creating a leaderstats and inserting IntValue.
-- Server Script --
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Parent = player
leaderstats.Name = "leaderstats"
local stage = Instance.new("IntValue")
stage.Parent = leaderstats
stage.Name = "Stage"
stage.Value = 0
end)
Now we have a leaderstats and IntValue called "Stage". So what you want to do now is to add teams and, insert a "SpawnLocation" and mark "AllowTeamChangeOnTouch". If you dont want players to see the teams you can insert a local script in starter gui and code:
game.StarterGui:SetCoreGuiEnabled("PlayerList ", false)
And now, we want that everytime we will touch the next spawn it will type in what stage the player is. So we need to insert a normal script in the SpawnLocation and script:
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:FindFirstChild(hit.Parent.Name)
player.leaderstats.Stage.Value = NUMBERHERE
end
end)
I hope I helped you and if I missed anything please let me know :D
This discussion is preserved as it was. New answers, comments, and votes are closed.
