Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My round script isn't giving the players the weapon once the round starts. Can someone help?

My round script isn't working, once a round starts it isn't giving the players the weapon. Here is the code.

local seconds = game.Workspace.Time
local ingame = game.Workspace.InGame.Value
local Game = game.Workspace.Game.Position


while true do
	wait(1)
	seconds.Value = seconds.Value - 1
	if seconds.Value == 0 and ingame == 0 then
		ingame = 1
		seconds.Value = 20
		local teleport = game.Players:GetChildren()
		for i = 1, #teleport do
			teleport[i].Character:MoveTo(Vector3.new(Game.X, Game.Y, Game.Z))
		end
	end

	if seconds.Value == 0 and ingame == 1 then
		ingame = 0
		seconds.Value = 15
		local teleport = game.Players:GetChildren()
		for i = 1, #teleport do
			teleport[i]:LoadCharacter()
			Players = game:GetService("Players")
			for i, player in pairs(Players:GetPlayers()) do
				game.Lightning.Weapon:Clone(#Players)
				game.Lightning.WoodSword:Clone(#Players).Parent = player.Backpack
			end
		end
	end
end

2 comments

0

Change line 33 to game.Lightning.WoodSword:Clone(#Players)

0

doesn't work..

1 answer

✓ Accepted answer

On line 33 game.Lightning.Weapon:Clone(#Players) wont work as #Players as # means number so #Players means number of players in the table/list/dictionary. You should probably change line 33 to something that corrilates to the actual player. Also game.Lightning is not a service. game.lighting is though. (notice the extra n after the t in lighting you put).

This discussion is preserved as it was. New answers, comments, and votes are closed.