I'm trying to have a claim area. Player steps on a brick then the plot I make will be theirs. But the script isn't working.
This is the code within the brick they step on to own the plot:
local ting = 0
owner = script.Parent.Parent.Parent.Owner
function onTouched(hit)
if ting == 0 then
ting = 1
check = hit.Parent:FindFirstChild("Humanoid")
if check ~= nil then
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
owner.Value = hit.Parent.Name
if user.isOwner.Value == 0 then
user.isOwner.Value = 1
local message = Instance.new("Message")
message.Text = "You now own this Building!"
message.Parent = user
script.Parent.Parent:remove()
wait(3)
message:remove()
end
end
ting = 0
end
end
script.Parent.Touched:connect(onTouched)
And this is the script within the plot to be claimed:
name = script.Parent
owner = name.Parent.Owner
while true do
if owner.Value ~= "" then
name.Name = owner.Value .. "s Building!"
else
name.Name = "Nobodys Building!"
end
wait(2)
end

1 comment
So basically like in a tycoon?