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

Script that you need enough leaderboard points (in game) to get a gear how do i do that?

Asked by 7 years ago
Edited 7 years ago

I dont know how to script.

0
This question.... It... It wont get answered dude.. Im sorryyyy GottaHaveAFunTime 218 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

I don't know if you want it to spend points but if you do here is the script, make sure to change out the parentheses with the answer to them (you will need to put it inside of a part in the game and get the tool you want from toolbox and put it inside ServerStorage):

01local debounce = false
02script.Parent.Touched:connect(function(hit)
03debounce = true
04local hum = hit.Parent:FindFirstChild("Humanoid")
05local a = hit.Parent.Name
06if hum and game.Players:FindFirstChild(a).leaderstats.(whatever your money is called).Value >= (how much you wan't them to spend) then
07    game.Players:FindFirstChild(a).leaderstats.(whatever your money is called).Value = game.Players:FindFirstChild(a).leaderstats.(whatever your money is called).Value - (how much you want them to spend)
08    tool = game.ServerStorage.(whatever your tool is called).Clone()
09    tool.Parent = game.Players:FindFirstChild(a).Backpack
10    wait(2)
11    debounce = false
12    end
13end)

if you don't have the leaderboard script, heres that:

1game.Players.PlayerAdded:connect(function(plr)
2    local leaderstats = Instance.new("Folder", plr)
3    leaderstats.Name = "leaderstats"
4 
5    local (what you want your currency to be called) = Instance.new("IntValue", leaderstats)
6    (whatever you named that variable).Name = (what you want your currency to be called)
7end)
Ad

Answer this question