FlaroxFX Posted July 30, 2015 Share Posted July 30, 2015 Hey, Today I tried a gate to scripts, the gate was set by the script, but it does not move when I want to move the gate, so when I type the command, Can anyone help me? Here the script: gate = createObject(980, -3117.3000488281, 471, 14.39999961853, 0, 0, 270) function opengate() moveObject(gate, 3000, -3117.3000488281, 471, 8.7) end addCommandHandler("test", opengate) function closegate() moveObject(gate, 3000, -3117.3000488281, 471, 14.39999961853) end addCommandHandler("test1", closegate)start Did I something wrong? Please Help !?! Link to comment
HUNGRY:3 Posted July 30, 2015 Share Posted July 30, 2015 local gate1 = createObject(980, -3117.3000488281, 471, 14.39999961853, 0, 0, 270) --the gate pos function Gate1(player) if not getElementData(player,"gater1") == true then setElementData(player,"gater1",true) moveObject(gate1, 3000, -3117.3000488281, 471, 8.7)-- this is when the gate open position else if getElementData(player,"gater1") == true then setElementData(player,"gater1",false) moveObject(gate1, 3000, -3117.3000488281, 471, 14.39999961853)-- this is when gate close position end end end addCommandHandler ("test", Gate1) -- to open the gate with same command it close/open Link to comment
FlaroxFX Posted July 30, 2015 Author Share Posted July 30, 2015 Okay, now I have tried your script, but the gate can not open anyway Link to comment
HUNGRY:3 Posted July 30, 2015 Share Posted July 30, 2015 just change the positions to some thing else and make sure it's not the same... Link to comment
FlaroxFX Posted July 30, 2015 Author Share Posted July 30, 2015 Okay , I change the position and do all again , but the gate doesnt open , why ? Link to comment
FlaroxFX Posted July 30, 2015 Author Share Posted July 30, 2015 Sorry when any word is wrong , i'm from Germany and I use the Google translater Link to comment
FlaroxFX Posted July 30, 2015 Author Share Posted July 30, 2015 local gate1 = createObject(980, -2131.6999511719, 504.20001220703, 36.799999237061, 0, 0, 270) function Gate1(player) if not getElementData(player,"gater1") == true then setElementData(player,"gater1",true) moveObject(gate1, 3000, -2131.6999511719, 504.20001220703, 31) else if getElementData(player,"gater1") == true then setElementData(player,"gater1",false) moveObject(gate1, 3000, -2131.6999511719, 504.20001220703, 36.799999237061) end end end addCommandHandler ("test", Gate1) Link to comment
HUNGRY:3 Posted July 30, 2015 Share Posted July 30, 2015 local gate1 = createObject(980, -2131.6999511719, 504.20001220703, 36.799999237061, 0, 0, 270) function Gate1(player) if not getElementData(player,"gater1") == true then setElementData(player,"gater1",true) moveObject(gate1, 3000, -2131.6999511719, 504.20001220703, 37.3848484) else if getElementData(player,"gater1") == true then setElementData(player,"gater1",false) moveObject(gate1, 3000, -2131.6999511719, 504.20001220703, 36.799999237061) end end end addCommandHandler ("test", Gate1) Type /test to open and close Link to comment
xShocKz Posted July 30, 2015 Share Posted July 30, 2015 Use the debug and tell us what it says... Link to comment
FlaroxFX Posted July 30, 2015 Author Share Posted July 30, 2015 What I need to do to use the debug , im a newcomer Link to comment
alcholistu Posted July 30, 2015 Share Posted July 30, 2015 local gate1 = createObject(980, -2131.6999511719, 504.20001220703, 36.799999237061, 0, 0, 270) local gateopened = false function Gate1() if not gateopened then moveObject(gate1, 3000, -2131.6999511719, 504.20001220703, 37.3848484) gateopened = true else moveObject(gate1, 3000, -2131.6999511719, 504.20001220703, 36.799999237061) gateopened = false end end addCommandHandler ("test", Gate1) Try this Link to comment
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