Where did I go wrong

I can’t tell what I did wrong…


local Thrower = script.Parent
local Debris = game:GetService(“Debris”)

local function hiter(kill, hit)
if hit.Parent:FindFirstChild(“Humanoid”) then
local character = hit.Parent
kill:Destroy()
character.Humanoid.Health = character.Humanoid.Health - (character.Humanoid.MaxHealth /3)
end
end

local function createfireball()
local fireball = Instance.new(“Part”)
fireball.Position = Thrower.Position + Vector3.new(0,-2,0)
fireball.Shape = “Ball”
fireball.Size = Vector3.new(2,2,2)
fireball.BrickColor = BrickColor.Red()
fireball.CanCollide = false
fireball.Parent = workspace

fireball.Touched:Connect(function(hit)
	hiter(hit, fireball)
end)

local fire = Instance.new("Fire",fireball)

local force = Instance.new("BodyForce")
force.Force = Vector3.new(0,-10,0)
force.Parent = fireball

Debris:AddItem(fireball, 1)

end

while true do
createfireball()
wait(1)
end

createfireball()


the script kills the player, but it’s not killing the player

1 Like

It seems like you have written kill and hit in wrong order in the parenthesis when creating the hiter function.

1 Like

ok I look at it and see if it works

1 Like

Thank you that helped :slightly_smiling_face: