Jump to content

Problems with two commands


Recommended Posts

i am trying to make a plane crash on easter bay bridge

this is what i have so far

function planecrash ( player ) 
   outputChatBox ( "!!!!LOOK OUT BELOW!!!!" ) 
   local plane = createObject( 1681, -1740.3088378906, 411.09747314453, 109.56239318848, 0, 0, 0 ) 
   local smokin = createObject ( 2780, -1740, 411, 109 ) 
   local smokin2 = createObject ( 2780, -1738, 411, 109 ) 
   attachElementToElement ( smokin, plane, -1.5, -4, 0 ) 
   attachElementToElement ( smokin2, plane, 1.5, -4, 0 ) 
   setTimer ( moveObject, 1000, 1, plane, 10000, -1699.7166748047, 502.56951904297, 84.887832641602, -4.5, -11.5, -34 ) 
   setTimer ( moveObject, 11010, 1, plane, 10000, -1527.2728271484, 689.72906494141, 58.848167419434, -5, 11.5, -10.5 )  
   setTimer ( moveObject, 21020, 1, plane, 10000, -1444.8721923828, 774.34039306641, 50.639617919922, 9.5, -16, 9 ) 
   setTimer ( moveObject, 31030, 1, plane, 10000, -1381.8197021484, 860.57458496094, 53.381561279297, 7.5, 41.5, -10 ) 
   setTimer ( moveObject, 41040, 1, plane, 10000, -1285.4609375, 943.88037109375, 47.282379150391, -3, -21, -4.5 ) 
   setTimer ( moveObject, 51050, 1, plane, 10000, -1223.9165039063, 1008.3391113281, 44.425498962402, -2.5, -4.5, 13.5 ) 
   setTimer ( createExplosion, 62000, 1, -1223, 1008, 44, 4 ) 
   setTimer ( destroyElement, 62000, 1, plane ) 
   setTimer ( destroyElement, 62000, 1, smokin ) 
   setTimer ( destroyElement, 62000, 1, smokin2 ) 
end 
  

plane flys down to bridge trys to land and then blows up

the two SMOKIN/SMOKIN2 objects are to make smoke come out of engines

what i want to do is use ( setObjectScale ) on the two smoke machines so u cant see them

and i also want to use ( setElementCollisionsEnabled ) on the PLANE so it will smash down lampposts on the bridge as it trys to land

script is working fine as is but i think i could make it better with these

thanx for any ideas :D

Link to comment

problem is when i try to use ( setObjectScale ) on the fog machines ID 2780 i get an error

cant seem to find exact error in server log for this one

and when i try to ( setCollisionsEnabled ) true on the plane ID 1681 i also get an error

: attempt to call global 'setCollisionsEnabled' (a nil value) 

Link to comment

thanx eai

ive got to pay more attention to what im typing :lol::roll:

with the objectScale being client side i dont think ill worry to much about it as im not very good at scripting and im not to sure how to do stuff client side ( not to important anyway for the time being )

i will test the collisions thing now

THANX AGAIN :D

EDIT ::

OK tried putting setElementCollisionsEnabled ( plane, true ) and i get this

: attempt to call global 'setElementCollisionsEnabled' (a nil value) 

looking at the wiki im pretty sure im writing it wrong but im not sure how to do it

Link to comment
thanx eai

ive got to pay more attention to what im typing :lol::roll:

with the objectScale being client side i dont think ill worry to much about it as im not very good at scripting and im not to sure how to do stuff client side ( not to important anyway for the time being )

i will test the collisions thing now

THANX AGAIN :D

EDIT ::

OK tried putting setElementCollisionsEnabled ( plane, true ) and i get this

: attempt to call global 'setElementCollisionsEnabled' (a nil value) 

looking at the wiki im pretty sure im writing it wrong but im not sure how to do it

setElementCollisionsEnabled is also client-side function.

Link to comment

that will be my problem then

i havent really tried client side functions very much

guess its time to learn EH :lol:

THANX for the replys eai and 50p ( gotta say i love that name 50p ) :D

EDIT :::

when i run the script above if im not standing fairly close to where it is created the plane never appears. the script gives no errors and if i make sure to be close to where the plane is created i can see it fine. does this mean i should try to run this sort of thing as a client side script so that it is synchronized properly or is this due to something else. if i do need to run it as a client side function is it just a case of setting the script to client in the meta or do i need a server side script as well

Thanx for any advice as i am trying to use moveObject and createObject like this quite a lot but this is the first time ive had this problem. :D

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...