I'm trying to make it so that if a player has enough money, and steps on a brick, another brick will appear.
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 >= v.Value - price then
brick.transparency = 0
else brick.transparency = 1
end
end)
And for some reason this didn't work.
Edit: This is my new script, but it still doesn't work, what's wrong with this one?
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)

2 comments
It's pretty clear. It's .Touched, not .onTouch
You forgot to capitalize the 'T''s in 'transparency' [brick.Transparency = 0].