Liberty Unleashed
Scripting => Script Help => Topic started by: silent_218 on March 11, 2011, 09:15:55 pm
-
I want to do more than one sphere... but all are teleport player to the one point.. i fink need to set sphere.id or "if sphere.pos".. and then they will teleport to the needed coordinates.. but it is too hard to get it by myself.. can help me anyone with it?
example
function onScriptLoad()
{
CreateSphere( Vector ( 89.51, -1548.7, 28.34 ), 3.00, Colour( 0, 0, 255 ) )
CreateSphere( Vector ( 351.501, -328.052, 173.163 ), 3.00, Colour( 0, 0, 255 ) )
return 1;
}
function onPlayerEnterSphere( pPlayer, sphere )
{
if (Sphere.Pos = Vector ( 89.51, -1548.7, 28.34 ))
{
pPlayer.Pos = Vector( 116.93, -1545.4, 244.58 )
}
if (Sphere.Pos = Vector ( 351.501, -328.052, 173.163 ))
{
pPlayer.Pos = Vector( 374.1, -327.9, 173.16 );
}
return 1;
}
-
Ok, for a start 'Sphere' is reserved by Squirrel, if you look at your script, you have:
function onPlayerEnterSphere( pPlayer, sphere )
So what you should be doing is..
function onPlayerEnterSphere( pPlayer, sphere )
{
if ( sphere.ID == 0 ) // do stuff
else if ( sphere.ID == 1 ) // etc
}
-
lol it's more easy than i think.. thanks alot it works :)
-
1. I can help with "scripting help topic" - will write all what i know for other players, don't you mind? :-) Where can i do it - here or at one place or need topic for each script?
2. How to create 5000 hidden packages if it limited by "331 on screen"? Cus i tryed create 332 in random places of LC, and can't see the last of them..
P.s. Thanks for position saver script, i change it for saving packages and it much easyer to write them on the map)
-
2. How to create 5000 hidden packages if it limited by "331 on screen"? Cus i tryed create 332 in random places of LC, and can't see the last of them..
The pickups beyond ID 330 should spawn, so that might be a bug with the pickup streamer, someone will take a look at it later.
-
I see, thx for the info..