There's nothing wrong with this script. The problem is when I use it once, and I try use it again, the blast will stay in one spot.
Script:
plr = game.Players.LocalPlayer mouse = plr:GetMouse() dmg = script.Damage unlocked = plr.PlasmaC.Value debounce = true mouse.KeyDown:connect(function(spell) if spell == "e" and unlocked == true and debounce == true then debounce = false print("PlasmaCannon") game:GetService("Chat"):Chat(plr.Character.Head, "Plasma Cannon!") p = Instance.new("Part", workspace) game.Debris:AddItem(p, 6) p.Shape = "Ball" p.Size = Vector3.new(10,10,10) p.Name = "PlasmaCannon" p.TopSurface = "Smooth" p.BottomSurface = "Smooth" p.CanCollide = false p.BrickColor = BrickColor.new("Bright blue") p.Transparency = .2 p.Anchored = false f = Instance.new("Fire", p) f.Size = 24 f.Heat = 11 f.Color = Color3.new(0, 55, 255) f.SecondaryColor = Color3.new(0, 31, 145) v = Instance.new("BodyVelocity", p) v.velocity = plr.Character.Torso.CFrame.lookVector*90 v.maxForce = Vector3.new(math.huge, math.huge, math.huge) p.CFrame = plr.Character.Torso.CFrame*CFrame.new(0, 0, -12) end wait(0.7) debounce = true end)
Try this. The mistake you made was that the script possibly made the script of parenting the velocity to the old projectile. Making "p", "f", and "v" local variable helps.
plr = game.Players.LocalPlayer mouse = plr:GetMouse() dmg = script.Damage unlocked = plr.PlasmaC.Value debounce = true mouse.KeyDown:connect(function(spell) spell = spell:lower() if spell == "e" and unlocked and debounce then debounce = false print("PlasmaCannon") game:GetService("Chat"):Chat(plr.Character.Head, "Plasma Cannon!") local p = Instance.new("Part", workspace) game.Debris:AddItem(p, 6) p.Shape = "Ball" p.Size = Vector3.new(10,10,10) p.Name = "PlasmaCannon" p.TopSurface = "Smooth" p.BottomSurface = "Smooth" p.CanCollide = false p.BrickColor = BrickColor.new("Bright blue") p.Transparency = .2 p.Anchored = false p:BreakJoints() local f = Instance.new("Fire", p) f.Size = 24 f.Heat = 11 f.Color = Color3.new(0, 55, 255) f.SecondaryColor = Color3.new(0, 31, 145) local v = Instance.new("BodyVelocity", p) v.velocity = plr.Character.Torso.CFrame.lookVector*90 v.maxForce = Vector3.new(math.huge, math.huge, math.huge) p.CFrame = plr.Character.Torso.CFrame*CFrame.new(0, 0, -12) wait(0.7) debounce = true end end)
Just move this code;
wait(0.7) debounce = true
Into the If Then statement.
plr = game.Players.LocalPlayer mouse = plr:GetMouse() dmg = script.Damage unlocked = plr.PlasmaC.Value debounce = true mouse.KeyDown:connect(function(spell) if spell == "e" and unlocked == true and debounce == true then debounce = false print("PlasmaCannon") game:GetService("Chat"):Chat(plr.Character.Head, "Plasma Cannon!") p = Instance.new("Part", workspace) game.Debris:AddItem(p, 6) p.Shape = "Ball" p.Size = Vector3.new(10,10,10) p.Name = "PlasmaCannon" p.TopSurface = "Smooth" p.BottomSurface = "Smooth" p.CanCollide = false p.BrickColor = BrickColor.new("Bright blue") p.Transparency = .2 p.Anchored = false f = Instance.new("Fire", p) f.Size = 24 f.Heat = 11 f.Color = Color3.new(0, 55, 255) f.SecondaryColor = Color3.new(0, 31, 145) v = Instance.new("BodyVelocity", p) v.velocity = plr.Character.Torso.CFrame.lookVector*90 v.maxForce = Vector3.new(math.huge, math.huge, math.huge) p.CFrame = plr.Character.Torso.CFrame*CFrame.new(0, 0, -12) wait(0.7) debounce = true end end)