Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   sword power? (https://forums.graalonline.com/forums/showthread.php?t=72603)

theHAWKER 03-05-2007 01:22 AM

sword power?
 
I want a door to open only if a person with a level 2 sword touches it.
ive try stuff like:
PHP Code:

if (playertouchsme && player.swordpower 2) {
hide;


and ive tryed other stuff like:
PHP Code:

if (playertouchsme && player.swordpower = >100) {
hide;


just to test but i think im useing the wrong scripts x.x
can someone help me?:confused: :confused: :confused:

godofwarares 03-05-2007 01:43 AM

Well first, Your syntax is wrong (You used = in the If operation instead of ==) -- Try this:

PHP Code:

if (playertouchsme && player.swordpower == 2)
{
hide;


This is hybridized though, I suggest you do:

PHP Code:

function onPlayerTouchsMe()
{
     if (
player.swordpower == 2)
     {
          
hide();
     }



konidias 03-05-2007 02:44 AM

Yeah also I noticed you did "= >100" not sure exactly what you were going for, but that arrangement isn't going to work either. They don't really show this in commands.rtf but it goes like:

A == B would be A is equal to B
A > B would be A is greater than B
A < B would be A is less than B
A >= B would be A is greater than or equal to B
A <= B would be A is less than or equal to B

You can't do it this way =< or =>

Twinny 03-05-2007 05:44 AM

Quote:

Originally Posted by konidias (Post 1284841)
Yeah also I noticed you did "= >100" not sure exactly what you were going for, but that arrangement isn't going to work either. They don't really show this in commands.rtf but it goes like:

A == B would be A is equal to B
A > B would be A is greater than B
A < B would be A is less than B
A >= B would be A is greater than or equal to B
A <= B would be A is less than or equal to B

You can't do it this way =< or =>

I've done => and I think it worked >_<

Angel_Light 03-05-2007 06:21 AM

Quote:

Originally Posted by Twinny (Post 1284924)
I've done => and I think it worked >_<

same, worked fine. :P I think he has a space between his so maybe thats why it didnt work.

Kristi 03-05-2007 07:50 PM

Quote:

Originally Posted by Twinny (Post 1284924)
I've done => and I think it worked >_<

Oh my god who cares if that works or not, for the love of god please do not do it!

Twinny 03-05-2007 10:58 PM

Quote:

Originally Posted by Kristi (Post 1285136)
Oh my god who cares if that works or not, for the love of god please do not do it!

I also do == to set variables :D

just kidding

napo_p2p 03-05-2007 11:03 PM

Quote:

Originally Posted by Kristi (Post 1285136)
Oh my god who cares if that works or not, for the love of god please do not do it!

Yes, this is one of the reasons why UN is so difficult to convert to GS2. Just because something works, it doesn't mean that it is the right way to do it (it might even just come back to bite you ... or someone else >:O).

I have scars.

Gambet 03-05-2007 11:20 PM

Quote:

Originally Posted by napo_p2p (Post 1285189)
Yes, this is one of the reasons why UN is so difficult to convert to GS2. Just because something works, it doesn't mean that it is the right way to do it (it might even just come back to bite you ... or someone else >:O).

I have scars.



No one's forcing you to do it. You should have known what you were getting into, I mean, we are talking about UN here. :rolleyes:

Chandler 03-05-2007 11:22 PM

I don't know if either of you are trying to be funny, but have some respect.
I don't complain about how ugly either of you two script, so what in hell gives you the right to do it?

Kristi 03-06-2007 12:38 AM

Quote:

Originally Posted by Chandler (Post 1285199)
I don't know if either of you are trying to be funny, but have some respect.
I don't complain about how ugly either of you two script, so what in hell gives you the right to do it?

My post production scripts are pretty >:o

It is not an astethics issue either. => would break in most languages, it is a habit you want to break out of asap.


All times are GMT +2. The time now is 05:01 AM.

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