I currently have a vest system and it should be setting the health when a player has a vest but for some reason, it just won't work at all it works perfectly fine without doing that but while doing it it won't work at all what is going on?
game.Players.PlayerAdded:Connect(function(Player) Player.CharacterAppearanceLoaded:Connect(function(Character) local Humanoid = Character:WaitForChild("Humanoid") ---PlayerHealth local MaxHealth = Humanoid.MaxHealth local Health = Humanoid.Health ---Vests local Vests = { ["TanVest"] = Character:FindFirstChild("TanVest"); ["BlackVest"] = Character:FindFirstChild("BlackVest"); } ---VestLocator local charChildren = Character:GetChildren() local tanVest = table.find(charChildren, Vests.TanVest) local blackVest = table.find(charChildren, Vests.BlackVest) if tanVest then --This without the math works fine but with the math wont, same fo the elseif Health = 150 MaxHealth = 150 print("Player has a TanVest") elseif blackVest then print("Player has a BlackVest") Health = 200 MaxHealth = 200 else print("Player has no vest") end end) end)
you must humanoid.Maxhealth = 150 not maxhealth = humanoid.maxhealth , maxhealth = 150 this is a mistake of beginner scripter if you write maxhealth = 150 it just change the variable but you write humanoid.maxhealth it change value