#Can't make my character burn
47 messages · Page 1 of 1 (latest)
Firstly, use output tab to check for errors.
Secondly, the problem is that Instance isnt a property of an object
To fix it use
Instance.new("Fire", hit.Parent.HumanoidRootPart)
This wont actually kill the player though, just set them on visual fire. FYI
Wouldn't you just find first child of hit.parent that's humanoid?
To kill them and set them on fire, do hit.Parent.Humanoid.Health = 0
:GetPlayerFromCharacter() returns nil if argument is not a character model
But then you'd have to make a whole variable for humanoid, so that's probably not productive
nil is falsy
Fixed this
Thats what hes doing, testing if its true.
The problem isnt gonna be with that part
I was answering @frozen dawn
Ah
Yea I was talking about :FindFirstChild()
I may be wrong tho
I'm dum
It's fine. We can safely assume a valid character model has a humanoid.
No dumb, just learning.
I'm bad S1 smh
No .Humanoid works fine, aslong as you arent using a custom character, in which case you should either find the first descendant named Humanoid or find the first part OF TYPE humanoid
okay it works but what if i want that it makes damages ?
Set the humanoid.Health property to 0
Or if you want less dmg, do
humanoid.Health -= 20
But youd also have to remove the fire eventually that way
wait(idk)
fire:destroy()
Hmmm...
Wdym
best er said that i had to set the humanoid.health property to 0
but where do i make that , like at start of the script
sorry if i am confusing
game.Workspace.Siege.Touched:Connect(function(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) then Instance.new("Fire", hit.Parent.Humanoid.Health -= 20) end end)
** You are now Level 1! **
game.Workspace.Siege.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
local fire = Instance.new("Fire", hit.Parent)
for i = 1, 3 do
wait(1)
if hit.Parent.Humanoid.Health < 20 then
hit.Parent.Humanoid.Health -= 20
else
hit.Parent.Humanoid.Health = 0
break
end
end
fire:Destroy()
end
end)
the Instance.new function is meant to determine a new object, not define another object's properties. Put it in a seperate line like this
hit.Parent.Humanoid.Health -= 20)```
the , hit.Parent part defines the parent of the object your making.