Page 1 of 1

Three Variales Startpiont

Posted: Sat Jul 13, 2013 1:02 pm
by Ballerlocke
hi all i want to wirte a script and in the onload i want to make a if between three varibels start pionts the first and second he reads but no time the third won

Code: Select all

player:update();
local zoneid = RoMScript("GetZoneID()")
if ( zoneid == 401 ) then
__WPL:setWaypointIndex(__WPL:findWaypointTag("Gildenstart"));
printf ("Gildenstart.");
elseif ( zoneid == 2001 or 2002 or 2 ) then
__WPL:setWaypointIndex(__WPL:findWaypointTag("Varanasstart"));
printf ("Varanas.");
elseif ( zoneid == 6 ) then
__WPL:setWaypointIndex(__WPL:findWaypointTag("Obsidanstart"));
printf ("Osidan.");
else
printf ("CANT FIND START.");
end
thanks for help

Re: Three Variales Startpiont

Posted: Sat Jul 13, 2013 2:55 pm
by rock5
It's because this is wrong

Code: Select all

elseif ( zoneid == 2001 or 2002 or 2 ) then
That's the same as writing

Code: Select all

elseif ( zoneid == 2001) or ( 2002) or ( 2 ) then
Any value that is not false or nil is considered true so (2002) and (2) will both always be true so it never passes that line.

What you meant was

Code: Select all

elseif ( zoneid == 2001 or zoneid == 2002 or zoneid == 2 ) then