Actimel Posted May 27, 2017 Share Posted May 27, 2017 (edited) hi guys i have problem with gate script. It worked before but now it seems doesnt work. error https://prnt.sc/fcufup --create the gate (DO NOT EDIT) local ggate = createObject ( GateObject, Defx, Defy, defz, rotX, rotY, rotZ) --DO NOT EDIT function gateopen ( p ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(p)), aclGetGroup(ACL)) then moveObject (ggate, OpenTime, opx, opy, opz) outputChatBox("Admin base gate opened", p,0,255,0,true) else outputChatBox("Sorry you dont have permission to do that!", p,0,255,0,true) end end addCommandHandler( opencommand, gateopen) function gateclose ( p ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(p)), aclGetGroup(ACL)) then moveObject (ggate, OpenTime, Defx, Defy, defz) outputChatBox("Admin base gate closed", p,0,255,0,true) else outputChatBox("Sorry you dont have permission to do that!", p,0,255,0,true) end end addCommandHandler( closecommand, gateclose) function handlerFunction(thePlayer) local oX, oY, oZ = getElementPosition(ggate) if math.floor(oZ) == math.floor(defz) then gateopen(thePlayer) elseif math.floor(oZ) == math.floor(opz) then gateclose(thePlayer) end end addEventHandler("onResourceStart", getResourceRootElement(), function() for i, k in ipairs(getElementsByType("player")) do bindKey(k, "K", "down", handlerFunction) end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "K", "down", handlerFunction) end) Edited May 27, 2017 by Actimel Link to comment
pa3ck Posted May 27, 2017 Share Posted May 27, 2017 Is the script set to be server side? (type="server" in meta.xml) Link to comment
Actimel Posted May 27, 2017 Author Share Posted May 27, 2017 2 minutes ago, pa3ck said: Is the script set to be server side? (type="server" in meta.xml) oh yeah my bad :DDD thx Link to comment
pa3ck Posted May 27, 2017 Share Posted May 27, 2017 Yea.. it happens sometimes, you're welcome 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