So when your infected in my game your suppose to die when you touch this yellow door but you dont die. It does nothing at all, and when you get infected you dont gain all the health your suppose to and I don’t know how to fix this. I know that its from this line of code with no errors.
if Player.Team == game.Teams.Infected then
if Team_Player == true then
Character.Humanoid.Name = "InfectedHumanoid"
local newAnim = Instance.new("Animation")
newAnim.AnimationId = InfectAnim
Character.InfectedHumanoid.WalkSpeed = 0
Character.InfectedHumanoid.JumpPower = 0
Character.InfectedHumanoid.MaxHealth = 55
Character.InfectedHumanoid.Health = Character.InfectedHumanoid.MaxHealth
script.Parent.Animate.idle.Animation1.AnimationId = "rbxassetid://8177163203"
script.Parent.Animate.idle.Animation2.AnimationId = "rbxassetid://8177163203"
script.Parent.Animate.run.RunAnim.AnimationId = "rbxassetid://8177414818"
script.Parent.Animate.walk.WalkAnim.AnimationId = "rbxassetid://8177414818"
Character.InfectedHumanoid.Animator:LoadAnimation(newAnim):Play()
wait(8)
Character.InfectedHumanoid.WalkSpeed = 10
Character.InfectedHumanoid.JumpPower = 20
Team_Player = false
script.Parent.InfectHitScript.Disabled = false
Player.PlayerGui.InfectedPunchGui.Enabled = true
Player.Backpack:ClearAllChildren()
if Character:FindFirstChild("Club") then
Character.Club:Destroy()
end
end
Puddles that infect you:
local team = BrickColor.new(“Really red”);
local part = script.Parent
part.Touched:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
if hit.Parent:FindFirstChild(“Humanoid”) then
plr.TeamColor = team
end
end
end)
you die when you hit the door
when your too low you turn infected:
Humanoid.HealthChanged:Connect(function(Health)
if Health <= 20 and Health ~= 0 and Player.Team == game.Teams.Players then
Player.TeamColor = BrickColor.new(“Really red”)
Humanoid.MaxHealth = 55
Humanoid.Health = 55
end
end)
– you dont die when you hit the door
they both use the same code which is this
Player:GetPropertyChangedSignal(“Team”):Connect(function()
if Player.Team == game.Teams.Infected then
if Team_Player == true then
Character.Humanoid.Name = “InfectedHumanoid”
local newAnim = Instance.new(“Animation”)
newAnim.AnimationId = InfectAnim
Character.InfectedHumanoid.WalkSpeed = 0
Character.InfectedHumanoid.JumpPower = 0
script.Parent.Animate.idle.Animation1.AnimationId = “rbxassetid://8177163203”
script.Parent.Animate.idle.Animation2.AnimationId = “rbxassetid://8177163203”
script.Parent.Animate.run.RunAnim.AnimationId = “rbxassetid://8177414818”
script.Parent.Animate.walk.WalkAnim.AnimationId = “rbxassetid://8177414818”
Character.InfectedHumanoid.Animator:LoadAnimation(newAnim):Play()
wait(8)
Character.InfectedHumanoid.WalkSpeed = 10
Character.InfectedHumanoid.JumpPower = 20
Team_Player = false
script.Parent.InfectHitScript.Disabled = false
Player.PlayerGui.InfectedPunchGui.Enabled = true
Player.Backpack:ClearAllChildren()
if Character:FindFirstChild(“Club”) then
Character.Club:Destroy()
end
end
try to use specific number values for health and maxhealth (dont make health equal to maxhealth via path) and dont name the humanoid to something else (might break something)