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

Doesn't seem to save up on the leaderboard, answer?

Asked by 8 years ago
enabled = true

script.Parent.Touched:connect(function(hit)
humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid ~= nil and enabled == true then 
    enabled = false
    player = game.Players:GetPlayerFromCharacter(hit.Parent) 
    cash = player.leaderstats.Points 
    cash.Value = cash.Value + 50000
    wait(10)
    enabled = true
end
end)

This is a script i made for a tycoon. I have cash on the leaderboard, the dropper adds cash to a block, i can collect that cash, and it works with the upgrade buttons, but when i touch the brick to give me cash, the separate brick, it gives me 50,000 cash, but it doesn't save. So say i have 10 cash from the amount the dropper gave me, and then i go onto the brick that gives me 50,000 cash, it adds to the leaderboard, but then if i go get the cash from the dropper, say like 10 more cash, it switches from 50,010, to just 20. How do i fix this?

0
Nothing looks wrong with this script. Share the script for the collecting the dropper cash. dyler3 1510 — 8y
0
I agree, nothing's wrong with your script :P User#11440 120 — 8y
0
But it doesn't save it, it just shows it but it really didn't change the actual value, like I said Supergamerboy1995 129 — 8y

1 answer

Log in to vote
0
Answered by
Sir_Melio 221 Moderation Voter
8 years ago

It only changes the value in the leaderstats, if it changes from 50,010 to 20 then there's another object where the real cash is stored. When that object's value changes, it will also change the value on the leaderboard.

Ad

Answer this question