This is the third time I am asking this question and I apologize if this is a hassle for anyone, but It's a project that I need assistance on. So i've tried all suggestions but so far no difference has been made. The player lights up in flames, but they still take no damage what so ever. This is the script:
local firePart = script.Parent
local Players = game:GetService("Players");
firePart.Transparency = 1
local function LightOnFire(part)
local fire = part:FindFirstChild("Fire")
if not fire then
fire= Instance.new("Fire")
fire.Parent = part
local client = Players:GetPlayerFromCharacter(part.Parent)
if (client) then
local health = client.Character.Humanoid.Health
health = 100
health = health - 15
wait(3)
end
end
end
firePart.Touched:connect(LightOnFire)
Here a solution:
local firePart = script.Parent local Players = game.Players firePart.Transparency = 1 function LightOnFire(hit) local fire = hit.Parent:FindFirstChild("Fire") if fire then else local FireInstance = Instance.new("Fire") if hit.Parent:FindFirstChild("Humanoid") then FireInstance.Parent = hit.Parent.HumanoidRootPart local Humanoid = hit.Parent:FindFirstChild("Humanoid") repeat wait(3) Humanoid.Health = Humanoid.Health -15 until Humanoid.Health <= 0 print("f") end end end firePart.Touched:Connect(LightOnFire)
Actually you didn't checked for the humanoid so it didn't found it probaly. This one should work. I tested it.
here is a solution
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit:FindFirstChild("Fire"):Clone().Parent = hit.Parent end while true do if hit.Parent:FindFirstChild("Fire") then hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 15 wait(0.5) end end end)