Zcraks Posted August 17, 2019 Posted August 17, 2019 for k,i in pairs(pickups) do local pickup[k] = createPickup( i[1], i[2], i[3], i[4], i[5], 0) end function onPickupH (thePlayer) for k,v in pairs(pickups) do if source == pickup[k] then local num = k spawnPlayer(thePlayer,num[v][7],num[v][8],num[v][9],-40,getElementModel(thePlayer), v[10],0) end end end addEventHandler("onPickupHit", root, onPickupH) server.Lua:2 unexpected symbol near '['
Moderators IIYAMA Posted August 17, 2019 Moderators Posted August 17, 2019 (edited) 41 minutes ago, Zcraks said: server.Lua:2 unexpected symbol near '[' local pickup[k] = createPickup( i[1], i[2], i[3], i[4], i[5], 0) You shouldn't use the local keyword, when you are not declaring a local variable. Edited August 17, 2019 by IIYAMA 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