F-22 Posted July 28, 2011 Share Posted July 28, 2011 How could I make this script: https://wiki.multitheftauto.com/wiki/SetGarageOpen Be able to work whit any object(You get to plasticsgate and it moves when you aproach) Link to comment
F-22 Posted July 28, 2011 Author Share Posted July 28, 2011 erm, I'm not so good whit scripts... Can You write it, and I only enter coordinates? plz Link to comment
JR10 Posted July 28, 2011 Share Posted July 28, 2011 No, it's easy to make start to learn. WIKI: https://wiki.multitheftauto.com/wiki/Main_Page Link to comment
F-22 Posted July 28, 2011 Author Share Posted July 28, 2011 I know how to make some scripts(Race scripts, like speed boost)... But it's the first time I make RPG map... Link to comment
F-22 Posted July 28, 2011 Author Share Posted July 28, 2011 (edited) Door = createObject ( -2897.587890625, 494.71667480469, 5.4137649536133 ) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function (resource) local doorCube = createColCube(-2897.587890625, 494.71667480469, 5.4137649536133, 6, 10, 4) addEventHandler("onColShapeHit", doorCube, onDoorCubeHit) addEventHandler("onColShapeLeave", doorCube, ondoorCubeLeave) end) function onDoorCubeHit(hitElement, matchingDimension) if (getElementType(hitElement) == "player") then if (not isDoorOpen(Door)) then moveObject ( Door, 3000, -2897.587890625, 494.71667480469, 9.9137649536133 ) end end end function onDoorCubeLeave(leaveElement, matchingDimension) if (getElementType(leaveElement) == "player") then if (isDoorOpen(Door)) then moveObject ( Door, 3000, -2897.587890625, 494.71667480469, 5.4137649536133 ) end end end Would this work? Edited July 28, 2011 by Guest Link to comment
JR10 Posted July 28, 2011 Share Posted July 28, 2011 Yes, it will, don't double post. Link to comment
F-22 Posted July 28, 2011 Author Share Posted July 28, 2011 It dosent work for me Do I put it client or server? Link to comment
JR10 Posted July 28, 2011 Share Posted July 28, 2011 Door = createObject ( -2897.587890625, 494.71667480469, 5.4137649536133 ) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function (resource) local doorCube = createColCube(-2897.587890625, 494.71667480469, 5.4137649536133, 6, 10, 4) addEventHandler("onColShapeHit", doorCube, onDoorCubeHit) addEventHandler("onColShapeLeave", doorCube, ondoorCubeLeave) end) function onDoorCubeHit(hitElement, matchingDimension) if (getElementType(hitElement) == "player") then moveObject ( Door, 3000, -2897.587890625, 494.71667480469, 9.9137649536133 ) end end function onDoorCubeLeave(leaveElement, matchingDimension) if (getElementType(leaveElement) == "player") then moveObject ( Door, 3000, -2897.587890625, 494.71667480469, 5.4137649536133 ) end end Link to comment
Jaysds1 Posted July 28, 2011 Share Posted July 28, 2011 (edited) Put this script in Client-side or Server-Side. It'll work both sides. EDIT: I never knew JR10. Edited July 28, 2011 by Guest Link to comment
JR10 Posted July 28, 2011 Share Posted July 28, 2011 Why? it should work both sides, but why should he? It's server side too. 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