PDA

View Full Version : sword power?


theHAWKER
03-05-2007, 01:22 AM
I want a door to open only if a person with a level 2 sword touches it.
ive try stuff like:
if (playertouchsme && player.swordpower = 2) {
hide;
}
and ive tryed other stuff like:
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:


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


This is hybridized though, I suggest you do:


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