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 10-22-2003, 03:28 AM
Idrox0 Idrox0 is offline
Registered User
Join Date: Oct 2003
Posts: 66
Idrox0 is on a distinguished road
Money Script

Okay, I was trying a script to make a ton of money anywhere, and this is what I came up with:
NPC Code:

if (playerenters) timeout = 0.05;
if (timeout) {
if (mousedown) lay2 goldrupee,mousex,mousey;
timeout = 0.05;
}


But for some reason, it doesn't work. It's pretty obvious what I'm trying to acheive. Can anyone shed some light?
__________________
Reply With Quote
  #2  
Old 10-22-2003, 03:34 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
mousedown doesn't work inside a time out.
Try "leftmousebutton" instead.
Reply With Quote
  #3  
Old 10-22-2003, 03:51 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
More specifically, mousedown is an event, which is not to be placed within another conditional statement.

If you want it to drop once every time the mouse is clicked, you'd want to check for mousedown and leftmousebutton; otherwise, you'd put the leftmousebutton in a timeout.

Also, two other caveats:

-You can only lay money that you have
-It'll only work if you decrement the player's rupees, otherwise the NPC-Server will eat it
Reply With Quote
  #4  
Old 10-22-2003, 05:36 AM
Nappa Nappa is offline
The Great Nappa
Nappa's Avatar
Join Date: Sep 2003
Location: Florida
Posts: 1,911
Nappa is on a distinguished road
Send a message via AIM to Nappa
You'll need to use #v(mousex) and #v(mousey), otherwise it wont work(i believe).
__________________
Reply With Quote
  #5  
Old 10-22-2003, 05:37 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally posted by Nappa
You'll need to use #v(mousex) and #v(mousey), otherwise it wont work(i believe).
Nah, the lay2 command takes vars, not strings.
Reply With Quote
  #6  
Old 10-22-2003, 05:43 AM
Nappa Nappa is offline
The Great Nappa
Nappa's Avatar
Join Date: Sep 2003
Location: Florida
Posts: 1,911
Nappa is on a distinguished road
Send a message via AIM to Nappa
Ahh... ok. I was trying something using mousex and mousey, and it didnt work without #v(), so i figured it would be the same here. My apologies.
__________________
Reply With Quote
  #7  
Old 10-22-2003, 05:46 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally posted by Nappa
Ahh... ok. I was trying something using mousex and mousey, and it didnt work without #v(), so i figured it would be the same here. My apologies.
S'okay, that's a common misconception. The difference between the two is that you were using triggeractions, which send parameters as strings - that is, the words mousex and mousey themselves, rather than variables of those names.
Reply With Quote
  #8  
Old 10-23-2003, 10:11 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
I made something similiar to that a while ago. A long, looong while ago. o.O
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #9  
Old 10-23-2003, 10:56 PM
amonrabr amonrabr is offline
Scripter
Join Date: Nov 2001
Location: Brazil
Posts: 374
amonrabr is on a distinguished road
if(mousedown) lay2 goldrupee,mousex-1,mousey-1;
Reply With Quote
  #10  
Old 10-23-2003, 11:08 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally posted by amonrabr
if(mousedown) lay2 goldrupee,mousex-1,mousey-1;
Except for the fact that it would be called whenever you pressed any mouse button.
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 07:08 PM.


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