Hey there,
I got this script here that is meant to give a player ownership of a booth if they don’t already own a booth and if the the booth they are trying to claim doesn’t already have an owner. However when I test it when 1 player claims ownership of a booth and then another player tries to claim the same board it lets him have ownership as well. I have no idea what’s wrong so any help is very apricated. :))
Script:
local button = script.Parent
local frame2 = script.Parent.Parent
local frame3 = script.Parent.Parent.Parent.Frame3
local plr = game.Players.LocalPlayer
local Values = plr:WaitForChild("Values")
button.MouseButton1Click:Connect(function()
frame2.Visible = false
if game.Workspace:FindFirstChild(Values.Booth.Value).Owned.Value == true then
frame3.Visible = true
wait(3)
frame3.Visible = false
else
if Values.Own.Value == true then
frame3.TextLabel.Text = "You already own a booth!"
frame3.Visible = true
else
Values.Own.Value = true
game.Workspace:FindFirstChild(Values.Booth.Value).Owned.Value = true
game.Workspace:FindFirstChild(Values.Booth.Value).Owner.Value = plr.Name
end
end
end)