Hello, again. This is going to be frequent to enjoy my company;) I'm doing a lot better with the loops and stuff but I still have an issue with the Universal itemFind loop.
It doesn't seem to be running the proper parts of the Loop, I am getting the Ran notification, although my cursor is on the baseplate I'm not getting the notification of BasePart - ‘Baseplate’ the for i,v loop isn't running period.
I've had a lot of these similar issues with for loops weirdly not starting, I never seemed to find the fix for it:/ The Cursor also freezes in place every time I click...
checkForItem Is set to true when the item Is successfully sent to the proper inventory, or is set if the inventory is full and dismissed
local localPlayer = game:GetService("Players").LocalPlayer
local character = localPlayer.Character or localPlayer.CharacterAdded:wait()
local cursor = localPlayer:GetMouse(); local cursorPoint = cursor.Target
local checkForItem
local item_
if (checkForItem) then
while (checkForItem) do
print("Ran")
cursorPoint = cursor.Target
pcall(function()
if cursorPoint:IsA("BasePart") then --//Set to 'Tool'.
print("BasePart - '"..cursorPoint.."'")
for _, descendant in ipairs(cursorPoint:GetDescendants()) do
if findObject(descendant, "BoolValue", "ItemTag") then print("foundItem")
item_ = cursorPoint.Name
checkForItem = false
end
end
end
end)
wait(.5)
end
end

10 comments
I take on look at this code, I see on line 1, "lcal" and on line 4, checkForItem isn't even defined
Sorry, that was a copy and paste issue, It’s actually defined
you need to give us all pertinent information if you want a correct answer
It’s supposed to run first thing, and if I request an checkForItem
we could be lazy and just wrap it in a while loop
the issue is this only runs once then the if statement wont run again, it either needs to be called at some point or be always running.
suggesting I wrap it in a spawn thread?
personally id make checkforitem a bool value and a child of the script, and use .Changed to determine when to run.
I should probably just wrap it in a function and just call it then?
that would work fine. i didnt read over the script itself but as far as being called when needed, yes.