iFrank4927 Posted September 16, 2017 Share Posted September 16, 2017 Hello guys, i have a error and i dont know how to solve this, hope that u can help me 944 attempt to perform arithmetic on a boleaan value if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then local col = getElementData(getLocalPlayer(), "currentCol") if #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then return end Link to comment
iFrank4927 Posted September 17, 2017 Author Share Posted September 17, 2017 oh sorry i forgot, if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then Link to comment
koragg Posted September 18, 2017 Share Posted September 18, 2017 OK, first of all, you misspelled "getPlayerMaxAviableSlots()". Should be "getPlayerMaxAvailableSlots()" Try this: if itemName and (getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots()) then local col = getElementData(getLocalPlayer(), "currentCol") if #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then return end end Link to comment
iFrank4927 Posted September 18, 2017 Author Share Posted September 18, 2017 i try but the same error appear Link to comment
Moderators IIYAMA Posted September 19, 2017 Moderators Share Posted September 19, 2017 if col and #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then You cannot get the elements within a colshape, if the colshape doesn't exist. So you have to check if it exist, before doing the rest. if col and #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then Link to comment
koragg Posted September 19, 2017 Share Posted September 19, 2017 2 hours ago, IIYAMA said: if col and #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then You cannot get the elements within a colshape, if the colshape doesn't exist. So you have to check if it exist, before doing the rest. if col and #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then He gave another line as the error to me 1 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