local gui = script.Parent.Parent.Parent.ScreenGui.Camaro.Purchased local chevy = script.Parent.Parent.Chevy script.Parent.MouseButton1Click:connect(function() wait(0.3) if gui.Purchased.Value == true then chevy.BackgroundTransparency = 0 chevy.ImageTransparency = 0 chevy.Purchase.BackgroundTransparency = 0 chevy.Purchase.TextStrokeTransparency = 0 chevy.Purchase.TextTransparency = 0 elseif gui.Purchased.Value == false then print("hello") end end)
I'm trying to access a gui through a 'phone' app as a separate section. It doesn't work as the ScreenGui isn't a 'Valid member of PlayerGui' help?
Chevy = Phone.Chevy
The problem is that the script tries to find the SceenGui right when the player joins, which is when the StarterGuis haven't copied to the player yet.
To maybe fix this, just add a :WaitForChild() here:
local gui = script.Parent.Parent.Parent:WaitForChild("ScreenGui", 10).Camaro.Purchased -- add a waitforchild local chevy = script.Parent.Parent.Chevy script.Parent.MouseButton1Click:connect(function() wait(0.3) if gui.Purchased.Value == true then chevy.BackgroundTransparency = 0 chevy.ImageTransparency = 0 chevy.Purchase.BackgroundTransparency = 0 chevy.Purchase.TextStrokeTransparency = 0 chevy.Purchase.TextTransparency = 0 elseif gui.Purchased.Value == false then print("hello") end end)