I’m making a tycoon and am currently working on the plot ownership part yet it keep erroring.
Here’s the script:
local Owner = script.Parent.Parent.Owner
local Owned = script.Parent.Parent.Owned
local Plot = script.Parent.Parent.Parent
local TycoonDoor1 = script.Parent
local debounce = false
script.Parent.Touched:Connect(function(hit)
local plr = game.Players:FindFirstChild(hit.Parent.Name)
if plr.OwnsAPlot.Value == false then
if debounce == false then
if hit.Parent:FindFirstChild("Humanoid")then
if Owned.Value == false then
local label = script.Parent.Tycoon_OwnerName.Tycoon_OwnerNameLabel
label.Text = plr.Name.."'s Tycoon"
Owner.Value = plr.Name
Owned.Value = true
print(Plot.Name.." was claimed by "..plr.Name..".")
TycoonDoor1.CanCollide = false
Plot.Sign.TextDisplay.SurfaceGui.TextLabel.Text = plr.Name.."'s Tycoon"
plr.OwnsAPlot.Value = true
else
print("Plot is already owned!")
end
end
debounce = true
wait(0.5)
debounce = false
end
end
end)
heres a screenshot that shows the script and “OwnsAPlot” in the explorer inside the player: