hello, i’m trying to make script which will see if there an object as value in string value. i even tried debugging, script works but the other part of the script doesn’t work
local UnlockedBy = script.Parent.UnlockedBy.Value
while wait(0.5) do
if script.Parent.Parent:FindFirstChild(UnlockedBy):FindFirstChild("IsBuy").Value == true then
script.Parent.Head.Transparency = 0
script.Parent.Head.Attachment.BillboardGui.Enabled = true
end
end
Well, to my eyes the script looks fine and i tested the script. I didnt find any errors or complications. So could you explain a bit more on the meaning “other part of the script”. That way i could try to help you.
while wait(0.5) do
if script.Parent.Parent:FindFirstChild(UnlockedBy):FindFirstChild("IsBuy").Value == true then
--your code
break --add a break to the end
end
end
while wait(0.5) do
if script.Parent.Parent:FindFirstChild(UnlockedBy):FindFirstChild(“IsBuy”).Value == true then
script.Parent.Head.Transparency = 0
script.Parent.Head.Attachment.BillboardGui.Enabled = true
end
end
In this code you’re checking for a Child in “UnlockedBy” that doesn’t exist, based on the screenshot.
You would do
while wait(0.5) do
if script.Parent.Parent[UnlockedBy]:FindFirstChild(“IsBuy”).Value == true then
script.Parent.Head.Transparency = 0
script.Parent.Head.Attachment.BillboardGui.Enabled = true
break
end
end