So I’ve recently been working a decent amount with LuaU, but I’ve encountered some problems with my UI local scripts.
I’ve defined various parts of my UI as local variables, and then inserted their type. However I get a warning for doing this. W000: Type 'Instance' could not be converted to Frame
(or whatever the type I put in)
I’m not entirely sure what is causing this, however if I set their type to Instance I get warnings later down the line that say Instance does not have the property Size (or whatever property I am changing)
Does anyone know exactly the reason for this? Is it a bug potentially or am I doing something wrong!
Thanks in advance, kingerman88
Script
local player = Players.LocalPlayer;
local root:Frame = script.Parent:WaitForChild("Main"); --luau what?
local holder:Frame = root:WaitForChild("Holder");
local inProgress:Frame = holder:WaitForChild("InProgress");
local resourceSelection:Frame = holder:WaitForChild("Resources");
local slots:Frame = holder:WaitForChild("Slots");
Comment: If I use a service and do
local remote:RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent");
it works perfectly fine with no warning