Owner Door not working

Wait, wait, wait.

tycoon variable and game global variable are the same things if you put the script in ServerScriptService. I don’t understand why you created tycoon variable

print(“Hey”)
local tycoon = script.Parent.Parent
local items = {}

– Folders–
local purchaced = tycoon:WaitForChild(“Purchaced”)
local buttons = tycoon:WaitForChild(“Buttons”)
local mainparts = tycoon:WaitForChild(“MainParts”)
local scripts = tycoon:WaitForChild(“Scripts”)
local values = tycoon:WaitForChild(“Values”)

mainparts.OwnerDoor.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild(“Humanoid”) and values.OwnerValue.Value == nil then
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)

	values:FindFirstChild("OwnerValue").Value = Player
	mainparts.Sign.SurfaceGui.TextLabel.Text = Player.Name.."'s Factory"
	
	print("humanoid found")


end

end)

the tycoon variable is just the whole tycoon group and not the game itself

print something after this to see if the touched event is working.

ye it prints so it must be a problem witht he if statement

1 Like

This may sound weird but try Hit.Parent.Parent

Tried it but it didnt do anything. Though i am suprised it didnt error

Instead of nil try and values.OwnerValue.Value == " "

I don’t want to argue but I think you’re guessing

Im not I have had problems similar to this and what I suggested worked in most situations.

Did it but still doesnt work. Its so confusing it works perfectly in the tutorial. :confused:

Well… try and go back to the tutorial and pause when he shows the part about the if statement and copy what he has and also copy where he put the scripts and values in the explorer.

What’s the name of this script?

The script is called main script


Folder don’t have a Touched event

Do i need to put a touched event in?

Maybe do this?

mainparts.OwnerDoor.Touched:Connect(function(Hit)
local Humanoid - Hit.Parent:FindFirstChild("Humanoid")

if Humanoid and values.OwnerValue.Value == nil then
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)

1 Like

He’s already referenced MainParts. He doesn’t need tycoon before it.

I tired it and it still doesnt work T_T

Do this:

mainparts.OwnerDoor.Touched:Connect(function(Hit)
local Humanoid - Hit.Parent:FindFirstChild(“Humanoid”)

if Humanoid and values.OwnerValue.Value == nil then
local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)