Since I live abroad, I use a translator. If the translation is weird, please let me know!
I created a script that allows you to become the owner of a booth through proxyprompt.
ProximityPrompt.Triggered:Connect(function(player)
if Values.Owner.Value == nil then
Values.Owner.Value = player
ProximityPrompt.Enabled = false
end
end)
(“Values” is the path to the folder where the player’s values will be saved)
When a player becomes the owner of a booth, the player’s value is stored in the booth and proxyprompt is disabled.
However, since only the proxyprompt for one’s own booth is disabled, the player can also become the owner of another booth. Can you tell me how to prevent a player from accessing proxypromts from other booths when he becomes the owner of one booth?
You can create a for loop going trough all booths like
local hasbooth = false
for _, booth in pairs(workspace.Booths:GetChildren()) do
if booth.Values.Owner.Value == player then
hasbooth = true
break
end
end
if not hasbooth then
-- code
end