d43dr4 Posted January 1, 2013 Share Posted January 1, 2013 Hello guys, Happy new year 2013 I have two questions: How to make a moving object, i try OMG resource but it deosnt work.. so if u know another way please tell me. Second one, how to make a door opens if a player come closer to it , and close when the player go away THX.. Link to comment
abu5lf Posted January 1, 2013 Share Posted January 1, 2013 1- moveObject. 2- createMarker and isElementWithinMarker. Link to comment
Anderl Posted January 1, 2013 Share Posted January 1, 2013 moveObject createColRectangle Events: onColShapeHit, onColShapeLeave Link to comment
d43dr4 Posted January 1, 2013 Author Share Posted January 1, 2013 Guys look what i do : doormarker = createMarker ( -3743.6, -3022.52, 38, "cylinder", 10, 255, 0, 255, 255 ) door = createObject( 971, -3743.3999023438, -3022.6999511719, 44.700000762939, 0, 0, 270 ) function ( thePlayer, matchingDimension ) if isElementWithinMarker(thePlayer, doormarker) then moveObject ( door, 3743.3999023438, -3022.6999511719, 50 ) end end Not worked , can u correct please Debugscript: SCRIPT ERROR: door\xx.lua:4: 'name' expected near '(' Link to comment
Anderl Posted January 1, 2013 Share Posted January 1, 2013 1. Use local variables; 2. You need to set a name for the function; 3. Where is the event? Link to comment
manve1 Posted January 1, 2013 Share Posted January 1, 2013 local doormarker = createMarker ( -3743.6, -3022.52, 38, "cylinder", 10, 255, 0, 255, 255 ) local door = createObject( 971, -3743.3999023438, -3022.6999511719, 44.700000762939, 0, 0, 270 ) function moveIt( thePlayer, matchingDimension ) if isElementWithinMarker(thePlayer, doormarker) then moveObject ( door, 3743.3999023438, -3022.6999511719, 50 ) end end addEventHandler('onMarkerHit', doormarker, moveIt) 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