montenegro11 Posted January 12, 2014 Share Posted January 12, 2014 I can't run automatically resources, so I have to type it /start resourcename or run it on admin panel, I have resources with 3 gates, and I want to combine them all. Here's the script. gate = createObject ( 980, 2404.8999023438, -1659, 15, 0, 0, 90 ) function gateOpen ( ) moveObject ( gate, 2000, 2404.8999023438, -1659, 7 ) end addCommandHandler ( "gso", gateOpen ) function gateClose ( ) moveObject ( gate, 2000, 2404.8999023438, -1659, 15 ) end addCommandHandler ( "gsc", gateClose ) Second: gs1 = createObject ( 975, 2522.8999023438, -1722.1999511719, 13.39999961853, 0, 0, 179.74182128906 ) function gateOpen ( ) moveObject ( gs1, 5000, 2515.3999023438, -1722.1999511719, 13.39999961853 ) end addCommandHandler ( "gss", gateOpen ) function gateClose ( ) moveObject ( gs1, 5000, 2522.8999023438, -1722.1999511719, 13.39999961853 ) end addCommandHandler ( "gsd", gateClose ) Third: gs2 = createObject ( 976, 2540.69995917719, -1707.8000488281, 11.5, 0, 0, 270 ) function gateOpen ( ) moveObject ( gs2, 3000, 2540.69995917719, -1707.8000488281, 9.1999998092651 ) end addCommandHandler ( "cjo", gateOpen ) function gateClose ( ) moveObject ( gs2, 3000, 2540.69995917719, -1707.8000488281, 11.5 ) end addCommandHandler ( "cjc", gateClose ) If somebody can help me, please do so. Link to comment
Castillo Posted January 12, 2014 Share Posted January 12, 2014 Place all of three scripts in a single .lua file and rename function names. Link to comment
50p Posted January 12, 2014 Share Posted January 12, 2014 Just copy all the code and put in 1 file in 1 resource. You only have to do 1 thing, rename the functions because they all have the same names (eg. gateOpen, gateOpen2, etc.). Link to comment
montenegro11 Posted January 12, 2014 Author Share Posted January 12, 2014 gate = createObject ( 980, 2404.8999023438, -1659, 15, 0, 0, 90 ) function gateOpen ( ) moveObject ( gate, 2000, 2404.8999023438, -1659, 7 ) end addCommandHandler ( "gso", gateOpen ) function gateClose ( ) moveObject ( gate, 2000, 2404.8999023438, -1659, 15 ) end addCommandHandler ( "gsc", gateClose ) gs1 = createObject ( 975, 2522.8999023438, -1722.1999511719, 13.39999961853, 0, 0, 179.74182128906 ) function gateOpen1 ( ) moveObject ( gs1, 5000, 2515.3999023438, -1722.1999511719, 13.39999961853 ) end addCommandHandler ( "gss", gateOpen1 ) function gateClose1 ( ) moveObject ( gs1, 5000, 2522.8999023438, -1722.1999511719, 13.39999961853 ) end addCommandHandler ( "gsd", gateClose1 ) gs2 = createObject ( 976, 2540.69995917719, -1707.8000488281, 11.5, 0, 0, 270 ) function gateOpen2 ( ) moveObject ( gs2, 3000, 2540.69995917719, -1707.8000488281, 9.1999998092651 ) end addCommandHandler ( "cjo", gateOpen2 ) function gateClose2 ( ) moveObject ( gs2, 3000, 2540.69995917719, -1707.8000488281, 11.5 ) end addCommandHandler ( "cjc", gateClose2 ) Learning, kind of 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