Yeah I took the code out of the coroutine
like this?
Yeah I took the code out of the coroutine
like this?
Nevermind about using indexes then. Could it be Slotted boolean not being set to false ever? If the first iteration doesnât return anything when calling FindFirstChild(v) the if statement in question wonât be reached anymore.
If this doesnât help, Iâd advice to slowly simplify the script until you get to a code where this problem is gone. Something like ihavoc101 is suggesting.
Yeah I think its because I have too many loops nested inside of loops
if slot:FindFirstChild(v) then
print("Something is inside of this frame there")
else
print("There is nothing inside of here")
item.Parent = slot
item.Position = slot.Center.Position
spawn(function()
setSlot:FireServer(slot.Name,item.Name,"set")
end)
Logs.itemName = nil
WindowsXPBubble:Play()
Slotted = true
Holding = false
end
See that code?
Change it to:
print(slot:FindFirstChild(v))
To check if it even exists.
Its printing something called nil
That means there is no object inside that frame.
Alright so what part of the code would I change around then
Check if the object is actually in the item your indexing. Iâm unsure of your usecase, unfortunately. So I canât help you there.
I tried doing this and it still isnt working either
if slot:FindFirstChild(v) == nil then
print("nothing inside")
item.Parent = slot
item.Position = slot.Center.Position
spawn(function()
setSlot:FireServer(slot.Name,item.Name,"set")
end)
Logs.itemName = nil
WindowsXPBubble:Play()
Slotted = true
Holding = false
else
print("something inside")
break
end
That means that there is no child with the same name as the string in v specifies. Check the object your talking about and its children.
Alright so i removed the inside and just left the prints and it works but when I add the piece of code I need to add it doesnt work
if slot:FindFirstChild(v) == nil then
print("nothing inside")
--item.Parent = slot
--item.Position = slot.Center.Position
--spawn(function()
-- setSlot:FireServer(slot.Name,item.Name,"set")
--end)
--Logs.itemName = nil
--WindowsXPBubble:Play()
--Slotted = true
--Holding = false
else
print("something inside")
break
end
I donât know then, unfortunately, I donât understand your use case so I cannot provide much help. You should try to ask other programmers for their experience as well.
Alright well thanks for everything got me a bit closer to solving the problem