So I have created a balloon with a humanoid in it. The head is a balloon mesh and I shrunk all the other body parts inside the mesh. Below is 2 different scripts. The first one gives the player points if they pop the balloon and the other plays a pop sound and then removes the balloon all together. If I walk up to the balloon with a sword and pop it everything works great (Balloon gets popped and player receives points), but when I use a gun from a distance and kill the balloon it will delay about 4 seconds before popping and the player doesn't receive any points. Any idea on why this is happening?
StatName = "Points"
IncreaseValue = 20
local Humanoid = script.Parent.Humanoid
function PwntX_X()
local tag = Humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Leaderstats = tag.Value:findFirstChild("leaderstats")
if Leaderstats ~= nil then
Leaderstats[StatName].Value = Leaderstats[StatName].Value + IncreaseValue
wait(0.1)
script:remove()
end
end
end
end
Humanoid.Died:connect(PwntX_X)
--- next script
while true do
wait(.01)
if script.Parent.Humanoid.Health<1 then
wait(.01)
script.Parent.Sound:Play()
script.Parent:remove()
end
end

2 comments
use spawn(function()
free model code lmao