Hello,I inserted a localscript in starterpack and added this in the script. It works fine but I don't know how to add damage to it.Would I have to make a whole new script inside of this localscript? Any tips?
plr = script.Parent.Parent
local buttonPressed = false
mouse = plr:GetMouse()
mouse.KeyDown:connect(function(key)
key = key:lower()
if key == "b" then
if not buttonPressed then
buttonPressed = true
SmokeT = Instance.new("Smoke")
SmokeH = Instance.new("Smoke")
SmokeLL = Instance.new("Smoke")
SmokeRL = Instance.new("Smoke")
SmokeRA = Instance.new("Smoke")
SmokeLA = Instance.new("Smoke")
SmokeT.Parent = plr.Character.Head
SmokeH.Parent = plr.Character.Torso
SmokeLL.Parent= plr.Character["Right Arm"]
SmokeRL.Parent= plr.Character["Left Arm"]
SmokeRA.Parent= plr.Character["Right Leg"]
SmokeLA.Parent= plr.Character["Left Leg"]
wait(.5)
game:GetService("Chat"):Chat(plr.Character.Head, "Explosion!")
plr.Character.Head.Transparency = 1
plr.Character.Torso.Transparency = 1
plr.Character["Right Arm"].Transparency = 1
plr.Character["Right Leg"].Transparency = 1
plr.Character["Left Arm"].Transparency = 1
plr.Character["Left Leg"].Transparency = 1
SmokeE = Instance.new("Part")
SmokeE.Parent = plr.Character.Torso
SmokeE.Transparency = 0.7
SmokeE.BrickColor = BrickColor.new("Quill grey")
SmokeE.CFrame = CFrame.new(plr.Character.Torso.Position)
SmokeE.Anchored = true
SmokeE.CanCollide = false
SmokeE.BottomSurface = "Smooth"
SmokeE.TopSurface = "Smooth"
SmokeE.Shape = "Ball"
wait(6)
buttonPressed = false
end
end
end)

1 comment
That script is a bit long, can you narrow down your problem please