I wrote a script for a door for my tycoon that I am making and I got an error that said
(MainDoor is not a valid member of model "Workspace.TycoonModel.MainItems."OwnerDoor) and my script was⬇️
MainItems.OwnerDoor.MainDoor.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid") and Values.OwnerValue.Value == nil then
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
Values.OwnerValue.Value = Player
MainItems.OwnerDoor.MainDoor.SurfaceGui.TextLabel.Text = Values.OwnerValue.Value.. "
Tycoon"
end
end)
I was expecting that my script would work perfectly fine until I got a error