For example, if the humanoid health's value is z, then something happens. This is my code: if health = 0 then this code doesn't work. How do I make this code work?
When your using conditional statements, only == is valid. You would most likely only use = if your changing the transparency or for ex: Thing.Transparency = Thing.Transparency - num.
This is the correct way to use the if statement with the humanoids health :
local p = game.Players.LocalPlayer z = 0 if p.Character.Humanoid.Health == z then print("humanoids health is at 0") end
Try this.
local z = 0 if humanoid.Health == z then -- code end
You use == for equals to and = for assigning values.