I am trying to make a shop system like Piggy/Teddy, but it keep giving me a weird error. I wonder why it says attempt to index nil with 'IsA'. Here is the script
Callback:
local status
if btn:IsA("TextButton") or btn:IsA("ImageButton") then
status = checkStatus(btn)
end
Function:
local function checkStatus(btn)
if btn.Info.Status.TextColor3 == colors["red"] then
return "Selected"
elseif btn.Info.Status.TextColor3 == colors["green"] then
return "Owned"
elseif btn.Info.Status.TextColor3 == colors["yellow"] then
return "For Sale"
elseif btn.Info.Status.TextColor3 == colors["neutral"] then
return "Off-Sale"
end
end
I still don’t get it. Why does it keep giving me the error?
Idk what is the problem. But Im sure this is the cause of the error.
It need to duplicate the template and set the parent to a targeted screen. Maybe the child didn’t parented at the same time. I also tried if btn:FindFirstChild("Info) then but still didn’t work