undefined Posted June 3, 2014 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 )
Moderators IIYAMA Posted June 3, 2014 Moderators 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) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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