I need help on creating an Obby Leaderboard, I simply cannot figure out how to do it myself! All i want in this Obby Leaderboard is a Stage Place and a Deaths Place (No kills)
Once again How do you do this???
So let's start off with making a script that gives them the value.
game.Players.PlayerAdded:connect(function(player) local leaderstats = Instance.new("Model") leaderstats.Name = "leaderstats" leaderstats.Parent = player local money = Instance.new("IntValue") --We create a new IntValue money.Name = "Stage" --this is the name you want the leader-stat to be when it shows up in-game. money.Value = 1 --this is the value of money the new player starts out with. To change this, you can add some more code (shown later) money.Parent = leaderstats -- Set the money object as a child of the leaderstats object. end)
Now in studio, open the toolbox. Get a spawn. Insert a script in it saying:
function onTouched(part) name = script.Parent.Name local h = part.Parent:FindFirstChild("Humanoid") if h ~= nil then char = h.Parent player = char:GetPlayerFromCharacter(char) if player ~= nil then leaderstats = player.FindFirstChild("leaderstats") if leaderstats ~= nil then stage = leaderstats:FindFirstChild("Stage") if stage ~= nil then stage.Value = name end end end end end end script.Parent.Touched:connect(onTouched) -- Links event to function
Make sure that you name the part a number. The first spawn needs to be named 1, the second needs to be named 2, the third needs to be called 3, and so on.
(This only does the stage and this was not tested.) Tell me if it doesn't work. --PUB1