I’m working on a party system that is created through a remote event. When it fires through a text button, the party is created with no issues. The problem is that the player can make multiple parties, something I don’t want them to do. Here’s my code.
CreateParty.OnServerEvent:Connect(function(player)
print("Party formed")
local newParty = Instance.new("Team")
newParty.Parent = game.Teams
newParty.AutoAssignable = false
newParty.Name = player.Name .. "'s Party"
player.Team = newParty
if Teams:FindFirstChild(player.Name .. "'s Party") then
end
end)
What code can I write to prevent a new instance from being created?