So I am making a tycoon, and I have this:
local StringValue = script.Parent:WaitForChild("Value")
local SurfaceGui = script.Parent:WaitForChild("SurfaceGui")
local TextLabel = SurfaceGui:WaitForChild("TextLabel")
local Door = script.Parent
Door.Touched:connect(function(x)
local playername = x.Parent.Name
StringValue.Value = playername
TextLabel.Text = playername.."'s Tycoon"
end)
The problem with this is that if someone else touches the door the tycoon will be considered theirs. Is there a way to stop the function from running after it is touched by one person?
Thanks.
