|
| 10 Aug 2014 01:02 AM |
I'm trying to use this function to determine whether someone has too much of one object, but if once object has a value of 5 ore more, it prevents people form picking up other objects no matter what
countFull = function() for xCount = 1, width.Value do for yCount = 1, height.Value do if Backpack["coordinate {"..xCount..", "..yCount.."}"].item.Value ~= "" then local itemType = _G.globalTable.itemType(Backpack["coordinate {"..xCount..", "..yCount.."}"].item.Value); if itemType ~= "Assault" and itemType ~= "Burst" and itemType ~= "Submachine" and itemType ~= "Pistol" then if Backpack["coordinate {"..xCount..", "..yCount.."}"].count.Value >= 5 then if itemType == "Explosive Object" then return true; elseif itemType == "Health" then return true; end end end end end end return false; end |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2014 01:13 AM |
BoolValue?
I don't know much Lua, so sorry if this seems useless. |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2014 01:29 AM |
it's for number variables
1 |
|
|
| Report Abuse |
|
|
ZT6
|
  |
| Joined: 24 Dec 2012 |
| Total Posts: 225 |
|
| |
|
|
| 10 Aug 2014 02:54 AM |
oh yeah they are int values
2 |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2014 03:48 AM |
Question here:
if itemType == "Explosive Object" then return true; elseif itemType == "Health" then return true;
why not just:
if itemType == "Explosive Object" or itemType == "Health" then return true
? |
|
|
| Report Abuse |
|
|
|
| 10 Aug 2014 04:15 PM |
| @Brick, Because if either one of those haz a count value of 5, I won't be able to collect any more items. I wanted to try and keep the statements seperate so ti would only take affect on different items, but it isn't |
|
|
| Report Abuse |
|
|
| |
|