if rng == 1 then
game.Workspace:WaitForChild("ZombieSound"):Play()
local zombiesky = game:GetService("ReplicatedStorage"):WaitForChild("RedSky"):Clone()
zombiesky.Parent = game.Lighting
game.Workspace:WaitForChild("zombiestart"):Play()
for i,v in pairs(game:GetService("Players"):GetPlayers()) do
game.Workspace:WaitForChild("ZombieSound"):Play()
local zombiesky = game:GetService("ReplicatedStorage"):WaitForChild("RedSky"):Clone()
zombiesky.Parent = game.Lighting
game.Workspace:WaitForChild("zombiestart"):Play()
if v.TeamColor == BrickColor.new("Bright red") then
print(v.TeamColor)
local inventory = v.Backpack
v.Character:WaitForChild("Humanoid"):UnequipTools()
task.wait(1)
for i,h in pairs(inventory:GetChildren()) do
if h:IsA("Tool") then
h:Destroy()
end
end
task.wait(0.6)
local folder = game:GetService("ReplicatedStorage"):WaitForChild("ZombieStuff")
local zombiehead = folder:WaitForChild("ZombieHead"):Clone()
zombiehead.Parent = v.Character:WaitForChild("Head")
local zombieyell = folder:WaitForChild("zombiesound"):Clone()
zombieyell.Parent = v.Character
local clawtool = folder:WaitForChild("Claw"):Clone()
clawtool.Parent = v.Backpack
v.Character:WaitForChild("Shirt"):Destroy()
v.Character:WaitForChild("Pants"):Destroy()
task.spawn(function()
local shirt = Instance.new("Shirt")
shirt.ShirtTemplate = "rbxassetid://15947510"
shirt.Parent = v.Character
local pant = Instance.new("Pants")
pant.PantsTemplate = "rbxassetid://7156230"
pant.Parent = v.Character
end)
task.spawn(function()
for i,b in pairs(folder:WaitForChild("ZombieMeshes"):GetChildren()) do
local zombiemesh = b
b:Clone()
zombiemesh.Parent = v.Character
end
while true do
task.wait(3)
zombieyell:Play()
end
end)
v.Character:WaitForChild("IsZombie").Value = true
v.Character:WaitForChild("Humanoid").Health = v.Character:WaitForChild("Humanoid").Health + 50
v.Character:WaitForChild("ACS_Client"):WaitForChild("Stances"):WaitForChild("Mobility").Value += 5
end
end
end```
it is supposed to make the red team zombies, but it doesnt work
no errors ---------------------
bump ------------------------------
(it is supposed to make the red team zombies, but it doesnt work)
It would be nice if you followed the posting template provided when you select a category, and tell us what exactly is wrong.
I did tell you? ------------------------------
" it is supposed to make the red team zombies, but it doesnt work"
Not really. Does it error?
Nope I also said that ---------------
It’s a random chance for the red team to all turn into zombies, but for some reason it isn’t applying on to red team, it does’t print what i told it to but no errors either.
You are overusing :WaitForChild
badly. If it’s a server-side code (as it should be) you shouldn’t use it so much, if not at all. It makes debugging very difficult. If you mistyped a name of an object for example, the script will wait forever, and it will take at least 5 seconds before it will print out an error like this:
So you should try to wait a bit, maybe it will print out something alike.
ok I will replace some with findfirstchild
it still doesn’t print what i want it to
or do anything with the zombies ````-----
the entire script doesn’t work, it doesn’t error at all. It worked before, but not the way I wanted it to so I changed it and now it doesn’t work entirely
what is rng if rng is an objectValue change it to if rng.Value == 1 then
rng isn’t a object value ----------------------------------
rng is just a math.random ---------------------
if its not working then myb because its that the math.random() isn’t choosing 1
it is because the music plays, the if statement just doesn’t run