So i have this gun game,there are three people:A shooter,A hero and lastly is the civilians.The whole script works fine,however one problem i have is that a player can be something twice.So when i tested,i became the shooter twice. heres the output
KawaiiX_Jimin Is the Shooter KawaiiX_Jimin Is the Shooter
How do i make it so that i would not become the shooter twice and when the player is the hero,he cannot be the shooter vice versa
heres the code
local replicatedstorage = game:GetService("ReplicatedStorage")
local status = replicatedstorage:WaitForChild("StatusValue")
while true do
-- Intermission
for i = 60,1,-1 do
status.Value = "Intermission: "..i
wait(1)
end
function teleAll(x, y, z)
local pos = Vector3.new(515.98, 116.081, -211.75)
for _, plr in pairs(game:GetService("Players"):GetPlayers()) do
if plr.Character then
plr.Character:MoveTo(pos)
end
end
end
local map = game.ServerStorage.BaseMap
map:Clone().Parent = game.Workspace
status.Value = "Waiting For Teleport..."
wait(5)
teleAll(515.98, 116.081, -211.75)
players = game.Players:GetChildren() -- gets all players
ChosenPlayer =players[math.random(1,#players)] -- Gets a random PLayer
print(ChosenPlayer.Name.."Is the Shooter")
game.ReplicatedStorage.Library["Crystal Gun"]:Clone().Parent = ChosenPlayer.Backpack
ChosenPlayer2 = players[math.random(1,#players)]
game.ReplicatedStorage.Library["Fire Gun"]:Clone().Parent = ChosenPlayer2.Backpack
print(ChosenPlayer2.Name.."Is the Hero")
for o = 180,1,-1 do
status.Value = "Game in progress,Time left:"..o
wait(1)
end
game.Workspace.BaseMap:Destroy()
status.Value = "Game Over!Respawning at lobby..."
end

3 comments
It's not really something you should worry about if it only happens at the output. And if there's nothing off at your game, If I were you, I would not worry about it.
:/ dude i have to fix the issue of people being a shooter and a hero too
they will get the gun twice and i dont want that to happen