Give all players a sword (Minigames)

Hi there!

I’m remaking one of my old projects and can’t figure out how to give a sword to all players when certain minigames are chosen.

This is how it should go: (Ones with a * I need you to implement)

The previous minigame ends
A sword minigame is chosen
Swords are given to all players *
My round script detects 1 player left and sets the winner value to their username *

Round script in workspace:

local s = script.Stat
local vals = game.ReplicatedStorage.Values
t = 0
while true do
	local plrs = game.Players:GetChildren()
	if #plrs > 0 then
	t = 15
	repeat
		t = t-1
		s.Value = "Intermission: "..t
		wait(1)
	until t == 0
	s.Value = "Game is starting..."
	wait(2)
	local mapselect = game.ReplicatedStorage.Games:GetChildren()
	local choose = math.random(1, #mapselect)
	curnum = 0
	for i =1, #mapselect do
		curnum = curnum + 1
		if curnum == choose then
			mapselect[i]:Clone().Parent = workspace
			curmap = mapselect[i].Name
			s.Value = mapselect[i].Name.." has been chosen!"
		end
	end
	wait(2.5)
	local plrs = game.Players:GetChildren()
	for i = 1, #plrs do
		local num = math.random(1, 16)
		plrs[i].Character.Head.CFrame = CFrame.new(workspace.Teleports["Part"..num].Position)
		plrs[i].Character.Parent = workspace.Ingame
	end
	t=120
	repeat
		local ingame = workspace.Ingame:GetChildren()
		t = t-1
		s.Value = "Time left: "..t
		wait(1)
	until t == 0 or vals.Winner.Value ~= "" or #ingame == 0
	if vals.Winner.Value ~= "" then
			s.Value = vals.Winner.Value.." has won!"
			if game.Players:FindFirstChild(vals.Winner.Value).DoublePoints.Value == false then
		        game.Players[vals.Winner.Value].leaderstats.Points.Value += 50
				game.Players[vals.Winner.Value].leaderstats.Wins.Value += 1
			else
				game.Players[vals.Winner.Value].leaderstats.Points.Value += 100
				game.Players[vals.Winner.Value].leaderstats.Wins.Value += 1
			end
	else
		s.Value = "No one has won!"
	end
	wait(2)
	local ingame = workspace.Ingame:GetChildren()
	for i =1, #ingame do
		local plr = game.Players:GetPlayerFromCharacter(ingame[i])
		plr:LoadCharacter()
	end
		workspace[curmap]:Destroy()
		vals.Winner.Value = ""
	else
		s.Value = "Waiting for 2 players"
		wait(1)
	end
end

Ty!

local sword = -- path to sword
for i,v in pairs(game.Players:GetChildren()) do
	local c = sword:Clone()
	c.Parent = v.Character
end
2 Likes

Okay, I will try that and see if it helps

put that where your gonna add the swords

1 Like

It worked after I put it in, thanks a lot!

ok be sure to mark my answer as the solution :wink: