![]() |
event script help! NEW!
hi, im making this event script, called trivia. Basically, the events team actiongrabs a block, Im using block.png, and when he grabs it, a gui pops up and he types any question he can think of in a textedit gui, and he has to put the answer in the textedit gui below that. For some reason, when he hits apply, the question doesnt appear above the block. And when the player says the right answer, it doesnt show that they said the right answer D;.
Heres the script, please help: PHP Code:
-jamerson =] |
Well for starters, you shouldn't have functions in functions like that..
Also, you're mixing GS1 with GS2.. Instead of message you do.. this.chat = "a test message!"; And to reference TextEdit fields you have to use: MyGUI_TextEdit1.text So "message SPC "MyGUI_TextEdit1" SPC;" Looks like: this.chat = MyGUI_TextEdit1.text; |
Your whole thing is clientside. Your best bet is to use a DB NPC (or local level NPC), trigger serverside, then tell that NPC what the question and answer are. That NPC would then have to listen for player's chat and decide the winner.
|
ok, the question appears on the block ok, but whats wrong with this?
if (player.chat == "MyGUI_TextEdit2") { player.chat = "I got the answer right!"; } |
Quote:
To get the text of an object, you need to pull it from the 'text' variable of the control. |
| All times are GMT +2. The time now is 04:06 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.