function givemoneytoowner()
local animaska = script.Parent.Humanoid.Animator:LoadAnimation(script.Parent.atack)
animaska.Looped = false
animaska:Play(0,9,0.5)
script.Parent.creator.Value.leaderstats[âSpare partsâ].Value+=100
end
local sigomka = 0
while true do
if script.Parent and workspace:FindFirstChild(âEnemiesâ) then
if sigomka < 5 then
sigomka+=1
givemoneytoowner()
elseif sigomka >=5 then
local bybym =Instance.new(âExplosionâ,workspace)
bybym.Position = script.Parent.ExplodingBarrel.Head.Position
bybym.BlastPressure = 0
DamageAllTargetsInRange()
sigomka = 0
end
end
wait(0.5)
end
Please format your code with ``` â these thingies :âD
Anyways, where is this script located? Are there any errors in the output?
Iâm thinking script.Parent.ExplodingBarrel (or Head in it) doesnât exist, not setting the Position.
Could you put;