Need help with owner door

Everything works for this script but the players Base value doesn’t work for some reason

local A = true
script.Parent.Touched:Connect(function(touch)
	print("yay")
	if touch.Parent:FindFirstChild("Humanoid") then
		local plr = game.Players:GetPlayerFromCharacter(touch.Parent)
		local OwnerValue = plr.Base.Value
		if OwnerValue == ""  and A == true then
			OwnerValue = script.Parent.Parent
			script.Parent.BillboardGui.TextLabel.Text = "Owner: "..touch.Parent.Name
			script.Parent.Parent.Owner.Value = touch.Parent.Name
			A = false
			print("ayay")
		
			wait(.5)
			A = true
			end
	end
end)
2 Likes
local Owners = {"YourName","Name","Ok"}

game.Players.PlayerAdded:Connect(function(plr)
 for i,v in pairs(Owners) do
  if string.find(v,plr) then
     --stuff
print("owner joined")
--(Normal Script)
  end
 end
end)
1 Like

I want it to be like a tycoon owner door so whoever touches it first gets the tycoon.

i assume this is for like a owner door much like one of those VIP only doors i see often

local HitPart = game.Workspace.Part -- this is just an example
local list = {
	123456789
}
HitPart.Touched:Connect(function(hit)
	if hit.Parent:IsA("Model") then
		local plr = hit.Parent:GetPlayerFromCharacter()
		if table.find(list, plr.UserId) then
			HitPart.Transparency = .65
		end
	end
end)

I want it to be like a tycoon owner door so whoever touches it first gets the tycoon.
I want it to be like a tycoon owner door so whoever touches it first gets the tycoon.
I want it to be like a tycoon owner door so whoever touches it first gets the tycoon.
I want it to be like a tycoon owner door so whoever touches it first gets the tycoon.
I want it to be like a tycoon owner door so whoever touches it first gets the tycoon.
I want it to be like a tycoon owner door so whoever touches it first gets the tycoon.
I want it to be like a tycoon owner door so whoever touches it first gets the tycoon.
I want it to be like a tycoon owner door so whoever touches it first gets the tycoon.

1 Like
local Players = game:GetService("Players")
 
local part = --location
local function onTouched(part)
	local player = Players:GetPlayerFromCharacter(part.Parent)
	if not player then return end
	print(player.Name .. " pressed me!")
--Apply changes to the tycoon door name
end
part.Touched:Connect(onTouched)