|
| 21 Mar 2014 01:21 PM |
I need help with my game, i want to make my 'money.Value' to change by 10 every 60 secs if the player is not a civilian,they have to have a job (i'm making a city).
I tried: if not Players.Player.Team==Civilian money.Value= money.Value + 10 wait(60) end
but it doesn't work.
Please help me, i need to do this urgently!
:D PLZ HELP GUYS :D |
|
|
| Report Abuse |
|
|
Psihycho
|
  |
| Joined: 03 Dec 2011 |
| Total Posts: 4010 |
|
|
| 21 Mar 2014 01:34 PM |
Wrong forum.
if op in.wrong_forum==true then print("get out") end |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2014 01:35 PM |
| First of all, I'm no scripter, but I have been studying C++ and know a little Lua. I see what's your problem. First of all, it should add the money AFTER it waits 60 seconds. Second, you need to add a loop, so it doesn't add 10 money just once, but many times - in BASIC (lol don't judge me, everyone starts somewhere..) you use goto [somewhereinthecode]. Also I think that the money.Value thing is invalid. I'll try making something myself and post it here if it works. |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2014 01:52 PM |
Thanks, i appreiciate the help
|
|
|
| Report Abuse |
|
|
|
| 21 Mar 2014 01:58 PM |
Maybe i should do this instead:
while true do if not Player.Team==Civilian wait(60) Game.Workspace.Players:GetChildren GetService: "leaderstats" money.Value= money.Value + 10 end end |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2014 02:08 PM |
| I noticed something else. It doesn't specify a single player, but all of the players, which, I think, is not allowed in Lua. I'd rather make a script which inserts a local script into every player who enters the game. |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2014 02:17 PM |
How do i do this? i don't know how...
:3
|
|
|
| Report Abuse |
|
|
|
| 21 Mar 2014 02:19 PM |
| Neither I, you should ask at the Scripting forum or ask a scripter. |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2014 02:52 PM |
Ok, thanks for the help though...
|
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Mar 2014 03:19 PM |
You can ask a scripting question in Scripting Helpers page. They have a answer in short time for almost everything about script. |
|
|
| Report Abuse |
|
|