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

How do I make a +1 tool that ups a leaderstat by 1?

Asked by 7 years ago

Okay so if you go intro a simulator game and they have a tool that gives u a +1 on a leaderstat.

I would like to know how this is made If you need here is my leaderstat script & my save data script

[Leaderstat]

01game.Players.PlayerAdded:connect(function(player)
02    local Leaderstats = Instance.new("Folder")
03    Leaderstats.Name = "leaderstats"
04    Leaderstats.Parent = player
05 
06    local Level = Instance.new("IntValue")
07    Level.Name = "Level"
08    Level.Value = 1
09    Level.Parent = Leaderstats
10end)

[Datasave]

01function onPlayerEntered(player)
02wait()
03player:WaitForDataReady()
04repeat wait() until player:FindFirstChild("leaderstats")
05if player.DataReady then
06if player:findFirstChild("leaderstats") then
07local score = player.leaderstats:GetChildren()
08for i = 1,#score do
09local ScoreLoaded = player:LoadNumber(score[i].Name)
10wait()
11if ScoreLoaded ~= 0 then
12score[i].Value = ScoreLoaded
13end
14end
15end
View all 29 lines...
0
MouseClick HelperScripting -4 — 7y

Answer this question