I have this part of the script that works:
function FirstInfected(text,time) wait(18) players = game.Players:GetPlayers() for i,v in pairs(game.Players:GetPlayers()) do if #players>=1 then Wait() first_infected = players[math.random(1, #players)] first_infected.TeamColor = BrickColor.new("Bright orange") initial_loadout = game.Lighting.Revolver initial_loadout:clone().Parent = first_infected.Backpack
Then this part that nothing happen at all(no error messages):
if v.TeamColor == BrickColor.new("Bright orange")then survive_loadout = game.Lighting.Ak_47 survive_loadout:clone().Parent = v.StarterGear if v.TeamColor == BrickColor.new("Bright orange")then v.Character.Humanoid.WalkSpeed = 30 end end end
Then this part continues on and works:
local h = Instance.new("Hint",Workspace) h.Text=text wait(time) h:Destroy() end end FirstInfected("A player has been randomly infected!",3)
Why does it do this? Thanks
if v.TeamColor == BrickColor.new("Bright orange")then survive = game.Lighting.Ak_47 survive:clone() survive.Parent = v.StarterGear if v.TeamColor == BrickColor.new("Bright orange")then v.Character.Humanoid.WalkSpeed = 30 end end end
Try this.. I just cleaned it up and I don't believe you cant use _ when doing that? I might be wrong. But it doesn't look clean with it.