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

How do i add cash to my leaderboard with a part??

Asked by 8 years ago
    local cash = Instance.new("IntValue")
    cash.Name = "Cash"
    cash.Value = 0

    local cashmoney = game.ServerStorage.MoneyStorage:FindFirstChild(newPlayer.Name)
    if cashmoney ~= nil then
        cashmoney.Changed:connect(function()
            cash.Value = cashmoney.Value
        end)
    end

This is my script for having a leaderboard with cash on it, and it starts with 0, and also its a tycoon game. How do i make it so that if any player touches a certain part, somewhere in the middle of the map, it adds cash to their leaderboard?

0
do you mean just to add to the cash value? like cash.Value = cash.Value + 1 theCJarmy7 1293 — 8y
0
No because then I'm petty sure that would change the cash amount of a player when they just join. I need it to add on later, fro Supergamerboy1995 129 — 8y
0
just put it under a touch function and add it to the player who touched the brick. theCJarmy7 1293 — 8y
0
Yup that's exactly what I did, thank you. Supergamerboy1995 129 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

https://www.youtube.com/watch?v=rWbQ0x-Xjj4

i Highly recommend watching this video it tells you how to make a leaderboard,give cash every 1 sec (like a actual tycoon game),tells you how to give cash when you touch a brick

don't skip through to find the part where he tells you how to add cash its best you watch the tutorial twice and get to the point where you can write the script without looking at the video so when need to something besides adding cash you know how to do it

0
Thanks! Supergamerboy1995 129 — 8y
Ad

Answer this question