undefined Posted June 3, 2014 Share Posted June 3, 2014 Hi Guys! It's not work and debugscript is say it; WARNING: sel/test_s.lua:6: Bad Argument @ 'bindKey' Where is the my mistake? Client-Side function open() if (guiGetVisible (duyuruGrid) == true) then guiSetVisible(duyuruGrid, false) showCursor(false) elseif (guiGetVisible (duyuruGrid) == false) then guiSetVisible(duyuruGrid, true) showCursor(true) end end addEvent("openGUI", true) addEventHandler("openGUI", getRootElement(), open) Server-Side function open (player) if isObjectInACLGroup ( "user.".. getAccountName( getPlayerAccount( player ) ), aclGetGroup ( "Admin" ) ) then triggerClientEvent (player, "openGUI", player ) end end bindKey ( player, "L", "down", open ) Link to comment
Moderators IIYAMA Posted June 3, 2014 Moderators Share Posted June 3, 2014 You can't bind anything without a player? addEventHandler("onResourceStart",resourceRoot, function() local players = getElementsByType("player") for i=1,#players do bindKey ( players[i], "l", "down", open ) end end) addEventHandler("onPlayerJoin",root, function() bindKey ( source, "l", "down", open ) end) 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