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)

1 comment
Warning:
Color3.newuses numbers 0 to 1, not 0 to 255. E.g., Color3.new(0, 55, 255) should really beColor3.new(0, .215, 1)