I'm making a fireball script where you press Q to fire, but the damage part won't activate(Touched Event not activating).
local Player = script.Parent.Parent local mouse = Player:GetMouse() function Jutsu(key) if key:lower() == "q" then print("q activated") -------------------------[Chakra Removal]-------------------------------- Player.Backpack.cpvalue.Value = Player.Backpack.cpvalue.Value - 5 -------------------------[Jutsu]----------------------------------------- Flame = Instance.new("Part", Workspace) Flame.CFrame = Player.Character.Torso.CFrame * CFrame.new(0,0,-5) * CFrame.Angles(33,0,0) Flame.Shape = ("Ball") MeshFlame = Instance.new("SpecialMesh", Flame) MeshFlame.Scale = Vector3.new(2, 4, 2) MeshFlame.MeshType = "FileMesh" MeshFlame.MeshId = "http://www.roblox.com/asset/?id=25212400" MeshFlame.TextureId = "http://www.roblox.com/asset/?id=25212235" -------------------------[Velocity]-------------------------------------- Movement = Instance.new("BodyVelocity", Flame) Movement.maxForce = Vector3.new(math.huge, math.huge, math.huge) Movement.velocity = Player.Character.Torso.CFrame.lookVector*40 ------------------------[Effect]----------------------------------------- function onTouched(Hit) print("Got Touched") if Hit.Parent:FindFirstChild("Humanoid") ~= nil then Hit.Parent.Humanoid.Health = Hit.Parent.Humanoid.Health - 20 else Boom = Instance.new("Explosion", Flame) Boom.Position = Flame.Position end end Flame.Touched:connect(onTouched) -------------------------[Cooldown]-------------------------------------- script.Disabled = true wait(20) script.Disabled = false end end mouse.KeyDown:connect(Jutsu)
Maybe for some reason it thinks Flame doesn't exist? Try putting if Flame then on line 13, since everything has to do with Flame.