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

Could someone find out what is wrong with this tycoon script?

Asked by 10 years ago

I wanted to make it so that if a player has enough money, and steps on a button, other button(s) would appear. But this script didn't work.

plr = script.Parent.Parent.Parent.Parent.Parent.Parent
price = 0
brick = script.Parent.Parent.Parent["Seasoner - 1200"].Head

 script.Parent.Touched:connect (function() 
    local v = plr.leaderstats.Cash
    if  v.Value - price >= 0 then
    brick.Transparency = 0
    else brick.Transparency = 1
    end
end)

anyone know why?

0
Where is the script located at? Like, is it inside of the playergui? dyler3 1510 — 10y
0
It's inside a part, inside a model, in a model, in a model, in workspace zxcvbnm322 29 — 10y

1 answer

Log in to vote
0
Answered by
SirNoobly 165
10 years ago

If plr is an ObjectValue then try using local v = plr.Value.leaderstats.Cash.

0
plr is workspace zxcvbnm322 29 — 10y
0
Why is plr workspace? plr is supposed to be the player. Look at how you do leaderboards: http://wiki.roblox.com/index.php?title=Leaderboards SirNoobly 165 — 10y
Ad

Answer this question