dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 07 Dec 2012 03:53 PM |
Line 49 - alert_msg("Survive "..[20*waves].." seconds for "..[5*waves].." points to use at the shop!")
alert_msg is a function waves is a number
Output - 16:52:51 - Workspace.game_script:49: unexpected symbol near '[' |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 03:54 PM |
alert_msg("Survive "..20*waves.." seconds for "..5*waves.." points to use at the shop!")
Error 407:["Siggy.exe not found."] Please try again in a few moments. |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 07 Dec 2012 03:55 PM |
| I have to put it in brackets. Or one of the periods turn blue. |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 03:55 PM |
alert_msg("Survive "..20 * waves.." seconds for "..5 * waves.." points to use at the shop!")
Make sure "waves" is defined.
- thedestroyer115 |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 07 Dec 2012 03:56 PM |
| Meaning it'll be .20 not 20. |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 03:56 PM |
Put a space between them...? Or if you really can't figure it out just make the 20 a value and do this:
..value * waves..
- thedestroyer115 |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 03:56 PM |
You don't need the brackets, though...
Error 407:["Siggy.exe not found."] Please try again in a few moments. |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 07 Dec 2012 03:56 PM |
As I say again.
When I take out the brackets, the script considers it as .20.
waves is defined. Everything is defined. |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 07 Dec 2012 03:57 PM |
Yes you do. The script considers it as .20 then. Why don't you learn to script before you try to help others. Heres the whole script.
Plrs = {} game_version = "1.0.0" maps = {"town_square"} disaster_types = {"small_wave"}
function get_players() for i,v in pairs(game.Players:GetPlayers()) do table.insert(Plrs,v) end end
function clear_plr_tbl() for i,v in pairs(Plrs) do v:remove() end end
function alert_msg(msg) for i,v in pairs(game.Players:GetPlayers()) do if v:FindFirstChild("PlayerGui") then if v.PlayerGui:FindFirstChild("hud_main") then v.PlayerGui["hud_main"]["alert_frame"]["main_text"].Text = msg end end end end
while wait() do alert_msg("Welcome to dirk29's survive | Version "..game_version.." | Currently only 1 map") wait(4) alert_msg("Game is still currently in testing stages. Message dirk29 glitches") wait(3) ran_num_1 = math.random(1,#disaster_types) ran_num_2 = math.random(1,#maps) waves = math.random(1,5) alert_msg("Survive a ["..disaster_types[ran_num_2].."] attacking ["..waves.."] times on ["..maps[ran_num_1].."]") wait(4) b = game.Lighting["game_maps"][maps[ran_num_2]]:clone() b.Parent = game.Workspace b:MakeJoints() get_players() wait(2) for i,v in pairs(Plrs) do if v.Character then v.Character:MoveTo(b["player_spawn"].Position) end end alert_msg("Survive "..[20*waves].." seconds for "..[5*waves].." points to use at the shop!") w = game.Lighting[game_waves][disaster_types[ran_num_1]]:clone() for i = 1,waves do w:clone() wait(5) end wait(15) end
|
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 03:58 PM |
READ THIS OP: Just put a space between the .. and the number!
- thedestroyer115 |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 03:59 PM |
I find it funny that you insult the people who try to help you. I wish I had not given you your answer.
- thedestroyer115 |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 03:59 PM |
tostring(whatever*20)
You're trying to put together a string and number. Bad OP! |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 07 Dec 2012 04:00 PM |
You gave me no answer. Are you an idiot?
..[20]..
The script will consider that as '20'
..20..
The script will consider that as '.20'
Learn to script. |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 07 Dec 2012 04:01 PM |
Look at this line,
waves = math.random(1,5)
The value 'waves' is a number. |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 04:01 PM |
alert_msg("Survive "..tostring(20*waves).." seconds for "..tostring(5*waves).." points to use at the shop!")
Should work. |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 04:02 PM |
OMG FOOL DIRK29! STOP INSULTING! I JUST GAVE YOU YOUR ANSWERRRR!
.. 20 ..
Are you like mentally inadequate?
- thedestroyer115 |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
| |
|
|
| 07 Dec 2012 04:07 PM |
Oh my gawd. I just gave you your answer. I just tested it to prove you wrong. It worked, this worked:
print("hullofoo".. 20 .."yeah")
Now why are you calling me a fool? Because Because I helped you? Get out. I am disgusted with you.
- thedestroyer115 |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 04:09 PM |
| destroyer: Actually, that would throw 'attempt to concat int value with string' or something close to that. Needs to be tostring(20) |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 04:10 PM |
@Dirk Stop being arrogant
@TheDestroyer Stop freaking out.
-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]- |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 04:11 PM |
@Rendersettings
GO TEST IT YOUR SELF! |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 04:11 PM |
Sorry I am raging. No one believes me yet I am correct. I even tested it to prove my answer. ._.
- thedestroyer115 |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 04:13 PM |
I will talk nicely. Lua tries to convert a string to a number before throwing an error. Look:
strng = "20" number = strng + 20 print(number)
--> 40
- thedestroyer115 |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2012 04:16 PM |
I...actually completely forgot it did that. Too much C# for me. Carry on. |
|
|
| Report Abuse |
|
|
dirk29
|
  |
| Joined: 26 May 2010 |
| Total Posts: 1142 |
|
|
| 07 Dec 2012 04:19 PM |
| Sorry destroyer, I've been scripting for 5 hours now. It's been a long day. Thanks for the help. Sorry for the commotion. |
|
|
| Report Abuse |
|
|