I attempted to mess around with the children because i think thats the problem but I was unsuccessful
local tycoon = script.Parent.Parent
local mainItems = tycoon:FindFirstChild("MainItems")
local values = tycoon:FindFirstChild("Values")
mainItems.OwnerDoor.Door.Touched:Connect(function(hit)
if values.OwnerValue.Value == nil then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
if player:FindFirstChild("HasTycoon").Value == false then
values.OwnerValue.Value = player
end
end
end
end)
New contributor
RandomCoder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.