Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[SOLVED] attempt to perform arithmetic on local 'slotSize' (a userdata value)?

Asked by
Ziffixture 6913 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

Hello, I am really confused at the moment, since I'm debugging, could someone help me determine the issue with this portion of my Script? I may be just blind by those who know s the stress of debugging, be with me:)

There is a NumberValue is located inside of carrierInventory called Capacity, there is a statement that adds the slotSize (a NumberValue inside of the item, this represents how much space it takes up) to its current value, It doesn't seem to work properly, what's wrong?

clickDetector.MouseClick:Connect(function(player)
   local character = player.Character or player.CharacterAdded:wait()
   local capacity = carrierInventory:FindFirstChild("Capacity").Value
   toInventory = false
   if (character and item) then
      local slotSize = findObject(item, "StringValue", "SlotSize")
      capacity = capacity + slotSize
   end
end)

Thanks!

0
I figured out whats wrong, I didn't define slotSize's Value, just it's Object index Ziffixture 6913 — 5y

Answer this question