Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Money Script (https://forums.graalonline.com/forums/showthread.php?t=48757)

Idrox0 10-22-2003 03:28 AM

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?

DustyPorViva 10-22-2003 03:34 AM

mousedown doesn't work inside a time out.
Try "leftmousebutton" instead.

Lance 10-22-2003 03:51 AM

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

Nappa 10-22-2003 05:36 AM

You'll need to use #v(mousex) and #v(mousey), otherwise it wont work(i believe).

Lance 10-22-2003 05:37 AM

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.

Nappa 10-22-2003 05:43 AM

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.

Lance 10-22-2003 05:46 AM

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. :)

GoZelda 10-23-2003 10:11 PM

I made something similiar to that a while ago. A long, looong while ago. o.O

amonrabr 10-23-2003 10:56 PM

if(mousedown) lay2 goldrupee,mousex-1,mousey-1;

Lance 10-23-2003 11:08 PM

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.


All times are GMT +2. The time now is 07:35 PM.

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