5150 Posted May 15, 2016 Share Posted May 15, 2016 hey, could someone tell me how to make this script work in interior 6? local cell = createObject(2930, 1562.3000488281, -1634.3800048828, -87.699996948242, 0,0,90) function open() moveObject(cell, 3000, 1560.6, -1634.3800048828, -87.699996948242, 0,0,0) end addCommandHandler("AD1o", open) addCommandHandler("ADopenall", open) function close() moveObject(cell, 3000, 1562.3000488281, -1634.3800048828, -87.699996948242, 0,0,0) end addCommandHandler("AD1c", close) addCommandHandler("ADcloseall", open) Link to comment
5150 Posted May 15, 2016 Author Share Posted May 15, 2016 Sweet thanks. Do i put that after the create object? Link to comment
5150 Posted May 15, 2016 Author Share Posted May 15, 2016 so is this correct? local cell = createObject(2930, 1562.3000488281, -1634.3800048828, -87.699996948242, 0,0,90) setElementInterior (2930, 6) function open() moveObject(cell, 3000, 1560.6, -1634.3800048828, -87.699996948242, 0,0,0) end addCommandHandler("AD1o", open) addCommandHandler("ADopenall", open) function close() moveObject(cell, 3000, 1562.3000488281, -1634.3800048828, -87.699996948242, 0,0,0) end addCommandHandler("AD1c", close) addCommandHandler("ADcloseall", open) Link to comment
Dimos7 Posted May 15, 2016 Share Posted May 15, 2016 local cell = createObject(2930, 1562.3000488281, -1634.3800048828, -87.699996948242, 0,0,90) setElementInterior (cell, 6) function open() moveObject(cell, 3000, 1560.6, -1634.3800048828, -87.699996948242, 0,0,0) end addCommandHandler("AD1o", open) addCommandHandler("ADopenall", open) function close() moveObject(cell, 3000, 1562.3000488281, -1634.3800048828, -87.699996948242, 0,0,0) end addCommandHandler("AD1c", close) addCommandHandler("ADcloseall", open) Link to comment
5150 Posted May 15, 2016 Author Share Posted May 15, 2016 ahhh its the element name not number. thanks Link to comment
5150 Posted May 15, 2016 Author Share Posted May 15, 2016 hey one more question sorry.... if i want to allow the gate to open for only my team, is this correct? local gate1 = createObject(2930, 1575.2001953125, -1634.7001953125, -87.699996948242, 0,0,0) setElementInterior (gate1, 6) function open() local team = getPlayerTeam(thePlayer) if (team == "#000000Psycho Ma#990000ns Gang") then moveObject(gate1, 3000, 1575.2, -1636.1999511719, -87.699996948242, 0,0,0) end end addCommandHandler("gate1", open) function close() local team = getPlayerTeam(thePlayer) if (team == "#000000Psycho Ma#990000ns Gang") then moveObject(cell8, 3000, 1575.2001953125, -1634.7001953125, -87.699996948242, 0,0,0) end end addCommandHandler("gate1c", close) addCommandHandler("PMGCcloseall", close) Link to comment
ma2med Posted May 15, 2016 Share Posted May 15, 2016 local gate1 = createObject(2930, 1575.2001953125, -1634.7001953125, -87.699996948242, 0,0,0) setElementInterior (gate1, 6) function open(thePlayer) local team = getTeamName(getPlayerTeam(thePlayer)) if (team == "#000000Psycho Ma#990000ns Gang") then moveObject(gate1, 3000, 1575.2, -1636.1999511719, -87.699996948242, 0,0,0) end end addCommandHandler("gate1", open) function close(thePlayer) local team = getTeamName(getPlayerTeam(thePlayer)) if (team == "#000000Psycho Ma#990000ns Gang") then moveObject(cell8, 3000, 1575.2001953125, -1634.7001953125, -87.699996948242, 0,0,0) end Link to comment
swedishboy Posted May 15, 2016 Share Posted May 15, 2016 local gate1 = createObject(2930, 1575.2001953125, -1634.7001953125, -87.699996948242, 0,0,0) setElementInterior (gate1, 6) local AllowedToOpen = "ADD YOUR TEAM HERE" function open(thePlayer) if getElementType(thePlayer) == "player" then local myTeam = getPlayerTeam(thePlayer) if myTeam == getTeamFromName( AllowedToOpen ) then moveObject(gate1, 3000, 1575.2, -1636.1999511719, -87.699996948242, 0,0,0) end end end addCommandHandler("gate1", open) function close(thePlayer) if getElementType(thePlayer) == "player" then local myTeam = getPlayerTeam(thePlayer) if myTeam == getTeamFromName( AllowedToOpen ) then moveObject(gate1, 3000, 1575.2001953125, -1634.7001953125, -87.699996948242, 0,0,0) end end end addCommandHandler("gate1c", close) addCommandHandler("PMGCcloseall", close) 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