Jump to content

[HELP] NEED HELP pls


iFrank4927

Recommended Posts

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

OK, first of all, you misspelled "getPlayerMaxAviableSlots()". Should be "getPlayerMaxAvailableSlots()" :P

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
  • Moderators
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
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 xD

  • Haha 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...