|
| 19 Jun 2015 12:10 AM |
It still says: Players.Player1.PlayerGui.ScreenGui.bankframe.1000takeoff.L:8: attempt to compare number with userdata
what I've done false?
script:
player = game.Players.LocalPlayer playername = player.Name money = player.leaderstats.money.Value bankvalue = player.bankvalue b = 1000
script.Parent.MouseButton1Click:connect (function() if money >= b then do bankvalue = bankvalue +b money = money -b end end end)
|
|
|
| Report Abuse |
|
|
DrSaint
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 18429 |
|
|
| 19 Jun 2015 12:18 AM |
| Was b previous defined as something? |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 19 Jun 2015 12:23 AM |
when you're defining the money variable and you make it point to a property, it will not change with the property. Instead, define money as; money = player.leaderstats.money and when you need to read the money value, do money.Value, when you need to edit it, money.Value (+/-/other operators) #--numbers lol
as far as the connections you have an extra end
i've explained enough, i'll fix it lol
player = game.Players.LocalPlayer playername = player.Name money = player.leaderstats.money bankvalue = player.bankvalue b = 1000
script.Parent.MouseButton1Click:connect(function() if money >= b then bankvalue.Value = bankvalue.Value+b money.Value = money.Value-b end end)
-=Robo=- |
|
|
| Report Abuse |
|
|
| |
|
DrSaint
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 18429 |
|
|
| 19 Jun 2015 12:34 AM |
Dang. I wasn't even close. I knew it had to do with a value though.
Getting better doe. |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 19 Jun 2015 12:35 AM |
don't try to use that, i messed up --change the connection to; script.Parent.MouseButton1Click:connect(function() if money.Value >= b then bankvalue.Value = bankvalue.Value+b money.Value = money.Value-b end end)
-=Robo=- |
|
|
| Report Abuse |
|
|