_G.Snipers = {z}
local status = workspace.Values.Status
function begin()
workspace.Values.Snipers.Value = true
workspace.Values.Intermission.Value = false
local plr = game.Players:GetPlayers()
for i,v in pairs (plr)do
table.insert(_G.Snipers,v.Name) -- Only inserts one player into the table??? WHYY
print(v.Name..' is _G.Snipers')
local char = v.Character
local human = char:WaitForChild('Humanoid')
if char and human then
workspace.Values.Status.Value = 'The next gamemode is Snipers!'
wait(5)
char:WaitForChild'Torso'.CFrame = CFrame.new(workspace.Spawn.Position) -- Teleport to arena
status.Value = 'Based off the original "Quick Scoping", this game mode everyone faces off with a sniper to be the last one standing '
wait(5)
status.Value = 'Giving every player their sniper...'
game:GetService('ReplicatedStorage').Tools.Sniper:Clone().Parent = v:WaitForChild('Backpack')
end
wait(3)
for i = 100,0,-1 do
wait(1)
status.Value = 'Kill every player and be the last one standing to win!'
if #_G.Snipers == 1 then
for i,winner in pairs (_G.Snipers) do
if game.Players:FindFirstChild(winner) then --Finding the winner
if winner ~= nil then
status.Value = winner..' is the winner of the round and has recieved 100 CREDZ'
game:GetService('ReplicatedStorage').Bank:WaitForChild(winner).Value = game:GetService('ReplicatedStorage').Bank:WaitForChild(winner).Value + 100
workspace:FindFirstChild(winner).Humanoid.Health = 0
_G.Snipers = {} -- Reset Table
wait(3)
workspace.Values.Round.Value = false
workspace.Values.Intermission.Value =true
workspace.Values.Snipers.Value = false
script:remove()
break
end
end
end
end
break
end
end
end
begin()
I named where it errored but for some reason everytime it runs, it adds one player to the table, does anyone know what i did wrong?

13 comments
ignore the z i accidentally typed it.
Lines 26-29 are the logic causing you problem. Learning to properly indent can help prevent these problems. You insert a player, then check if there is only one player in the table (true), then try to find the player and remove the script so no other player is added to the table. Also, use :Destroy() instead of :remove().
if you dont mind my asking.. whats the difference between those two?
also, line 7-10 is also a problem because it doesnt load all the players into the table
Remove is deprecated and no longer supported. No that part works, you're just breaking the loop and deleting the script, preventing the loop that adds your players from continuing. Can you talk in the site or discord chat?
i sent you a fr on the site so that i can chat with you
What site? Roblox?
yes sir
That's too slow, and it's not easy to show code with that. Discord then?
yea, how will i chat with you on that?
https://discord.gg/c4SUv
im not allowed to chat it sais
Do you see a "Welcome" channel?