Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   help with event script (https://forums.graalonline.com/forums/showthread.php?t=83745)

[email protected] 01-18-2009 04:54 AM

help with event script
 
Hello, I have a question? Say I was making a water race, and I wanted to put 1 image at the end of the race, and if the player touches that image, we will call it "block.png", it will say "(account) has won the race"? Could someone tell me please?

Would it be something along the lines of this:

if (playertouchsme) {
message SPC player.account has won the race;
}


How would I do something like this?

cbk1994 01-18-2009 05:47 AM

PHP Code:

function onPlayerTouchsMe() {
  if (
chat == "") {
    
chat player.account SPC "has won the race!";
  }


You'll have to add some command for staff to reset the winner, by using something like this:

PHP Code:

function onPlayerChats() {
  if (
player.guild == "Staff" && player.chat == "/reset") {
    
chat "";
  }



Pelikano 01-18-2009 11:56 AM

Or much simpler:

"function onPlayerTouchsMe() {
if (chat == "") {
chat = player.account SPC "has won the race!";
sleep(3);
chat = "";
}
} "

cbk1994 01-18-2009 05:53 PM

Quote:

Originally Posted by Pelikano (Post 1457919)
Or much simpler:

PHP Code:

function onPlayerTouchsMe() {
  if (
chat == "") {
    
chat player.account SPC "has won the race!";
sleep(3);
chat "";
  }



Remember to use PHP tags for code so you don't lose indenting.

I try to not use sleeps whenever possible, in this case you may want to make it a longer sleep.


All times are GMT +2. The time now is 12:41 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.