Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-18-2009, 04:54 AM
[email protected] jamerson61894@yahoo.com is offline
Banned
Join Date: Jul 2008
Posts: 83
jamerson61894@yahoo.com is an unknown quantity at this point
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?
Reply With Quote
  #2  
Old 01-18-2009, 05:47 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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 "";
  }

__________________
Reply With Quote
  #3  
Old 01-18-2009, 11:56 AM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
Or much simpler:

"function onPlayerTouchsMe() {
if (chat == "") {
chat = player.account SPC "has won the race!";
sleep(3);
chat = "";
}
} "
Reply With Quote
  #4  
Old 01-18-2009, 05:53 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Pelikano View Post
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.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:40 AM.


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