So I have a script that I want it so only 1 shark can join and only 9 fish can join their team. The max amount of players in a server is 10. This script isn;t changing my team to sharks and I don't know why. This script is a local script inside a frame in a screengui in startergui.
local plr = game.Players.LocalPlayer
clicked = false
clicked2 = false
click1 = script.Parent:WaitForChild("Click1")
click2 = script.Parent:WaitForChild("Click2")
script.Parent.JoinSharks.MouseButton1Click:connect(function()
if clicked == false then
if workspace.SharksFull == false then
plr.TeamColor = BrickColor.new("Cyan")
if workspace.GameHasStarted.Value == false then
local spawns = workspace.SharkSpawn
plr.Character.Torso.CFrame = CFrame.new(spawns.Position)
end
end
end
clicked = true
end)
script.Parent.JoinFish.MouseButton1Click:connect(function()
click1.Value = click1.Value + 1
plr.TeamColor = BrickColor.new("Bright orange")
if workspace.GameHasStarted.Value == false then
local spawns = workspace.FishieSpawns:GetChildren()
local chosenspawn = spawns[math.random(1,#spawns)]
plr.Character.Torso.CFrame = CFrame.new(chosenspawn.Position)
end
end)

3 comments
WHERE IS THE EXPLANATION!
Fixed it.
That's better. I hope you learned your lesson.