I'm trying to make it where when Parts transparency == 0 then player gets +$50 every 10. Whats wrong with my script?
1 | local player = script.Parent.Transparency = = 0 |
2 | local stats = player:findFirstChild( "leaderstats" ) |
3 | local add = 50 |
4 | local cash = stats:findFirstChild( "Cash" ) |
5 | if script.Parent.Transparency = = 0 then |
6 | cash.Value = cash.Value + add |
7 | wait( 10 ) |
8 | end |
01 | while true do |
02 | player = script.Parent |
03 | if part.Transparency = = 0 then |
04 | local stats = player:findFirstChild( "leaderstats" ) |
05 | local add = 50 |
06 | local cash = stats:findFirstChild( "Cash" ) |
07 | cash.Value = cash.Value + add' |
08 | wait( 10 ) |
09 | end |
10 | end |
I think that should work, just identify where the part and player are.