This is supposed to make the player turn on fire and they will start losing health. But this fire script won't work. This script is in a brick:
01 | function loseHealth(part) |
02 | print ( "Gotta set this part on fire!" ) |
03 | print (part.Name) |
04 | fire = Instance.new( "Fire" ) |
05 | fire.Parent = part |
06 | --Now losing health... |
07 | for i = 100 , 0 , - 1 do |
08 | wait( 0.1 ) |
09 | part.Parent.Humanoid.Health = i |
10 | end |
11 | end |
Most of this is in the wiki, so why isn't this right?
01 | local burning = { } |
02 |
03 | function burnPlayer(player) |
04 | -- If the player is already burning, then stop the function. |
05 | if burning [ player ] then |
06 | return |
07 | end |
08 |
09 | -- Set that the player is burning in our table, using the player object as an index. |
10 | burning [ player ] = true |
11 |
12 | -- Create the fire in the character's head. |
13 | Instance.new( "Fire" , player.Character.Head) |
14 |
15 | -- Set a variable to the Humanoid for easy reference. |