| Blockland Forums > Modification Help |
| Major SyntaxError within function containing $variables |
| (1/1) |
| ThinkInvisible:
--- Code: ---function TGG_startup() {($TGGfact1 = "1");##(##$TGGfact2 = "10"); //## around error as usual. --- End code --- {($TGGfact1 = "1");##(##$TGGfact2 "1");##(##$TGGf What the heck is wrong with that code section? I'm trying to make a client-sided chat Guessing Game script, and it's epic failing because of that. By all means, it should work... (The parentheses were around those statements... It doesn't work even without those.) |
| Syntax:
you dont need parentheses to declare a variable --- Code: ---function TGG_startup() { $TGGfact1 = "1"; $TGGfact2 = "10"; } --- End code --- that is what it should look like |
| ThinkInvisible:
Another problem... Calling a If statement that tests subStr for something in the ClientCmdChatMessage thing : if (%msg = getSubStr(%msg,"0","14","Is the number ")) {bla bla bla} But for some reason, it never executes 'bla bla bla' |
| Syntax:
--- Quote from: ThinkInvisible on August 21, 2010, 09:17:20 PM ---Another problem... Calling a If statement that tests subStr for something in the ClientCmdChatMessage thing : if (%msg = getSubStr(%msg,"0","14","Is the number ")) {bla bla bla} But for some reason, it never executes 'bla bla bla' --- End quote --- if(%msg $= getSubStr(%msg,0,14)) { dothings.. } We use $= to compare two strings. Plus, you said =, so you are saying %msg IS getsubstr(blah); ,if it was not a string, you would need to check if it was EQUAL TO, which is ==. %this == %that? for string %this $= %that? |
| Navigation |
| Message Index |