71
Script Releases / Re: Mansion Gate
« Last post by sseebbyy on October 12, 2014, 12:19:33 am »By releasing this script to the public, you will help many newbies.
(I would use a class to create these gates, to make it easier, instead of this way)
But... there is a problem. What happens if the gate is not id 0 ?Another object will move instead of the gate.
To fix that, note the object with an word like "mansiongate".
How you do that ? Like this:
Then you simply move it using:
By the way, it's good that it uses a global function as "MoveGate", for closing/opening the gate.
I suggest you to add one more parameter that will represent the gate (object), so you can use the same function for any gate you want.
Like this:
(I would use a class to create these gates, to make it easier, instead of this way)
But... there is a problem. What happens if the gate is not id 0 ?Another object will move instead of the gate.
To fix that, note the object with an word like "mansiongate".
How you do that ? Like this:
Code: [Select]
mansiongate <- CreateObject(6000,0,Vector(-277, -495, 10),255);
Then you simply move it using:
Code: [Select]
mansiongate.MoveBy(Vector(-8,0,0), 2800);
By the way, it's good that it uses a global function as "MoveGate", for closing/opening the gate.
I suggest you to add one more parameter that will represent the gate (object), so you can use the same function for any gate you want.
Like this:
Code: [Select]
function MoveGate(player,gate,status)
{
if(status="open")
{
obj.MoveBy(Vector(8,0,0), 2800);
}
}