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

5 comments
Hmmm it still doesn't effect my walkspeed.
Ok I have no clue what I did but it worked now
okay that's good :D
Of course you can use
_in variable names. This answer is also WRONG since it doesn't use theclonecreated while the original answer did. This answer will work exactly once.Isn't that is needed? for it to work only once?