So as the title implies, I'm trying to create a damage script for my fireball, however, when fired no damage is done to a humanoid. Here is my script:
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")~= nil then
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 20
script.Parent:remove()
end
end)
Respond ASAP, Thanks!

8 comments
first of all the remove function is deprecated in favor of :Destroy()
Do what he said ^. Also, is it a server script or local script? It needs to be a server script.
yea use the "TakeDamage()" Methed as using the "Health" Method changes the health at a "Strange eneral" for some reason.
@ItzFoxz It's a server script, thanks for the advice.
Do you have a RemoteEvent?
Also is it a tool or when pressing a key to fire it?
@fr2013 It dosen't have a remoteevent because I don't really have any exprience with using them, and its a key to fire.
Alright hold on