Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Disabling Sword (https://forums.graalonline.com/forums/showthread.php?t=87690)

Mattehy 08-30-2009 10:48 PM

Disabling Sword
 
how do i disable a sword so it stop hitting player's hearts?

Soala 08-31-2009 02:32 AM

disableweapons;

cyan3 08-31-2009 02:42 AM

Quote:

Originally Posted by alexandralove (Post 1519958)
disableweapons;

disableweapons(); would be better.

Frankie 08-31-2009 02:46 AM

Quote:

Originally Posted by cyan3 (Post 1519960)
disableweapons(); would be better.

how so?

Soala 08-31-2009 02:52 AM

Was just giving the command actually =P

cyan3 08-31-2009 02:56 AM

Quote:

Originally Posted by Frankie (Post 1519963)
how so?

It would work with either way but I tend to use disableweapons(); instead of disableweapons;

Frankie 08-31-2009 03:05 AM

Quote:

Originally Posted by cyan3 (Post 1519968)
It would work with either way but I tend to use disableweapons(); instead of disableweapons;

yeah. I wasn't trying to be a smart ass or anything, I have always wondered what the point to that is. if there are no possible parameters for a function, why add (); to the end? maybe someone else can give a more technical response.

Gambet 08-31-2009 07:23 AM

Quote:

Originally Posted by Frankie (Post 1519972)
yeah. I wasn't trying to be a smart ass or anything, I have always wondered what the point to that is. if there are no possible parameters for a function, why add (); to the end? maybe someone else can give a more technical response.


It's just the difference between GS1 and GS2. GS2 is object-oriented so all commands were basically converted into functions, hence the parenthesis. Not all functions are required to use any specific parameters, in cases like these you just need to call the function without sending any information to it.

DustyPorViva 08-31-2009 04:25 PM

Quote:

Originally Posted by Gambet (Post 1520027)
It's just the difference between GS1 and GS2. GS2 is object-oriented so all commands were basically converted into functions, hence the parenthesis. Not all functions are required to use any specific parameters, in cases like these you just need to call the function without sending any information to it.

This.
Just because a function has no parameters to pass does not mean you should omit the parenthesis.


All times are GMT +2. The time now is 12:32 PM.

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