This script is in a regular (non-local) script, and is supposed to equip a weapon when a game begins.
Everything is defined, however, nothing works. I have no idea why, as output has given me nothing.
Can someone please help me?
Here's the script:
local Player = script.Parent.Parent
local GUI = script.Parent:WaitForChild("Loadout_GUI")
local Playing = game.ServerScriptService.MainGame:WaitForChild("Playing")
local P1 = Player.Classes[GUI.Classy.Value]:WaitForChild("Primary")
local S = Player.Classes[GUI.Classy.Value]:WaitForChild("Secondary")
while wait(0.1) do
if Playing.Value == true then
local Primary = game.ServerStorage.Weapons[P1.Value]:clone()
local Secondary = game.ServerStorage.Weapons[S.Value]:clone()
Primary.Parent = Player.Backpack
Secondary.Parent = Player.Backpack
Player.CameraMode = "LockFirstPerson"
Player.Character.Humanoid:EquipTool(Player:WaitForChild("Backpack"):WaitForChild(Primary.Name))
script:Destroy()
end
end
