So I want to shorten this by like tonnes... But I have no idea how to make it loop, so I just repeat it... Which is time consuming. And it also makes it really long... Does anyone have an idea how to loop it?
game.Workspace.Player.Humanoid.Health = game.Workspace.Player.Humanoid.Health-0.1 wait(1)
So I want to make that repeat... Instead of having it over and over... Thanks.
Hmm, try this;
repeat wait(1) game.Workspace.Player.Humanoid.Health = game.Workspace.Player.Humanoid.Health-0.1 until --This will repeat infinitly if you set it to 'nil', or add nil to it, but you can also set it to stop at a certain point if you want it to
Hope this helped!
If you have a given amount you want to poison, I'd use a for
loop. It would look something like this.
for i = 1, 10 do -- Execute the following code 10 times Humanoid:TakeDamage(3) -- Subtract 3 from the Humanoid's health end -- close for loop scope
while wait(1) do game.Workspace.Player.Humanoid.Health = game.Workspace.Player.Humanoid.Health-0.1 end