The script is not actually cloning the fire particle to all players, I know why, It’s because this script only clones the fire particle to player character head 1 times If you know what i mean, Should i try fix it with a loop until fires are cloned to all players head or something else?
for _,player in ipairs(game.Players:GetPlayers()) do
local character = player.Character
local head = character.Head
local fire = script.Fire:Clone()
fire.Parent = head
wait(5)
character.Humanoid.Health = 0
script:Destroy()
end
for _,player in ipairs(game.Players:GetPlayers()) do
spawn(function()
local character = player.Character
local head = character.Head
local fire = script.Fire:Clone()
fire.Parent = head
task.wait(5) -- new wait, more efficient and accurate
character.Humanoid.Health = 0
end)
end
script:Destroy()
When i tried it, It didn’t work, like it didn’t do anything. Have you tried it? I can give you something that comes with that script so you can test it out with your changes
It is highly recommended that you do not use spawn() or delay() due to it being deprecated, you can use coroutine instead for efficient functioning, you can just replace your spawn with coroutine.wrap()
(Reminder that the () near the end) is necessary to call the function after definition)