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):

local debounce = false
script.Parent.Touched:connect(function(hit)
debounce = true
local hum = hit.Parent:FindFirstChild("Humanoid")
local a = hit.Parent.Name
if hum and game.Players:FindFirstChild(a).leaderstats.(whatever your money is called).Value >= (how much you wan't them to spend) then
    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)
    tool = game.ServerStorage.(whatever your tool is called).Clone()
    tool.Parent = game.Players:FindFirstChild(a).Backpack
    wait(2)
    debounce = false
    end
end)

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


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

Answer this question