ander17 Posted November 20, 2011 Posted November 20, 2011 how to make a script to open the doors via the command because I want to put a base and command to open doors: sorry my bad english
12p Posted November 20, 2011 Posted November 20, 2011 createObject / getElementByID addCommandHandler moveObject
mcB Posted November 21, 2011 Posted November 21, 2011 yourGatesName = createObject ( Object id, x, y, z, rotX, rotY, rotZ) [color=#0040FF][b]function[/b][/color] openGate (source) [color=#FF0000][b]moveObject[/b][/color] (yourGatesName, int time, new pos X, new pos Y, new pos Z) -- example time = 3500, and the coordinates where you want the object to end up [color=#FF0000][b]outputChatBox[/b][/color] ("You opened your gate!" source, 255, 255, 255) --optional, but its my habit to see if the function was made right [color=#0040FF][b]end[/b][/color] addCommandHandler ("open", openGate ) -- OR doors? for automatic gates [color=#0040FF][b]local[/b][/color] firstGateMarker = createMarker ( x, y, z, "corona", size, R, G, B, Alpha ) --Outside the door [color=#0040FF][b]local[/b][/color] secondGateMarker = createMarker ( x, y, z, "corona", size, R, G, B, Alpha ) -- Inside the door yourGatesName = createObject ( Object id, x, y, z, rotX, rotY, rotZ) [color=#0040FF][b]function[/b][/color] [color=#FF0000][b]moveObject[/b][/color] (yourGatesName, int time, new pos X, new pos Y, new pos Z) [color=#0040FF][b]end[/b][/color] addEventHandler( "onMarkerHit", firstGateMarker, yourGatesName) addEventHandler( "onMarkerHit", secondGateMarker, yourGatesName )
NotAvailable Posted November 21, 2011 Posted November 21, 2011 I would have used an table. But yeah this way is good to help beginners.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now