The ROBLOX sword players get when teleporting from the lobby to the arena in my game is not working, you can't swing and I cant see other player's swords. I think it might be because it's in a localScript, if so, how could I get around it?
Here's the code, if it helps:
local player = game.Players.LocalPlayer
local plrGui = player.PlayerGui
local intermissionTime = 30 -- in secs
local roundTime = 180 -- roundtime in secs
local timerMode = 1 -- 1 means intermission, 2 means round mode
local timerGui = plrGui.timerGUI
timerGui.Frame.modeLabel.Text = "Intermission" -- set it to intermission when the game
-- starts so it isnt blank
while wait(1) do
-- set timeLabel text to whatever the time left is
if timerMode == 1 then
roundTime = 180 -- set roundTime back to 180 since we're
-- in intermission right now
intermissionTime = intermissionTime - 1
timerGui.Frame.timeLabel.Text = (tostring(intermissionTime))
if intermissionTime < 1 then
timerMode = 2
timerGui.Frame.modeLabel.Text = "Match"
-- give players swords
local players = game:GetService("Players")
for _,player in ipairs(game.Players:getChildren()) do
local tool = game.ReplicatedStorage.ClassicSword:Clone()
tool.Parent = player.Backpack
end
-- teleport all the players to the arena
target = CFrame.new(13.8, 1.5, 42.3) --could be near a brick or in a new area
for i, player in ipairs(game.Players:GetChildren()) do
--Make sure the character exists and its HumanoidRootPart exists
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
--add an offset of 5 for each character
player.Character.HumanoidRootPart.CFrame = target + Vector3.new(0, i * 5, 0)
end
end
end
elseif timerMode == 2 then
intermissionTime = 30 -- set intermissionTime back to 30
roundTime = roundTime - 1
timerGui.Frame.timeLabel.Text = tostring(roundTime)
if roundTime < 1 then
timerMode = 1
timerGui.Frame.modeLabel.Text = "Intermission"
-- remove player swords
local Players = game:GetService("Players")
for _, Player in pairs(Players:GetPlayers()) do
local Char = Player.Character or Player.CharactedAdded:Wait()
local GearInPlayer = Player:FindFirstChild("Backpack")
local GearInCharacter = Char:GetChildren()
GearInPlayer:ClearAllChildren()
-- teleport players to lobby
target = CFrame.new(112.55, 102.989, 184.3) --could be near a brick or in a new area
for i, player in ipairs(game.Players:GetChildren()) do
--Make sure the character exists and its HumanoidRootPart exists
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
--add an offset of 5 for each character
player.Character.HumanoidRootPart.CFrame = target + Vector3.new(0, i * 5, 0)
end
end
end
end
end
end

2 comments
well if we don't know the sword code we can't exactly fix the sword
A game-script should never be Local.