Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   why doesnt this work? (https://forums.graalonline.com/forums/showthread.php?t=35412)

zorakid2001 08-09-2002 01:30 AM

why doesnt this work?
 
if (keypressed) {
setarray rockthrow,3;
rockthrow.[0]=3.14/2;
rockthrow.[1]=3.14;
rockthrow.[2]=3.14*3/2;
rockthrow.[3]=0;
if (this.on==1&&strequals(#p(1),y)) {shoot playerx,playery,playerz,rockthrow.[playerdir],1,0,shoot,wbrock.gif;}
}

i want my little man to throw a rock the direction that hes facing but i dont think i did it right

Falcor 08-09-2002 01:53 AM

I see one mistake right off the bat, the array lenght does not indicate the last index, but the acual lenght of the array. 4 slots, arraylen = 4... so

setarray rockthrow,4;

also, there is no period before the [], its just rockthrow[#]

There are easier ways to do this, but i'll let you figure that out.

SingleChance 08-09-2002 03:51 AM

Itll be a good script

screen_name 08-09-2002 12:45 PM

arrayname = {index0,index1,index2,index3};

JrTerrorist 08-10-2002 12:40 AM

Re: Re: why doesnt this work?
 
Quote:

Originally posted by Kaimetsu


Array positions are accessed like so: "rockthrow[index]", NOT like so: "rockthrow.[index]"

what he said

zorakid2001 08-10-2002 01:52 AM

Thank you guys =D yet another addition to my Wonderful server


All times are GMT +2. The time now is 07:27 AM.

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