https://gyazo.com/b1a9f0df972f5121569b7694ab029fa4
if Value == "rapidbeam" then
local beam = game:GetService("ReplicatedStorage"):WaitForChild("Beam"):Clone()
local explosion = game:GetService("ReplicatedStorage"):WaitForChild("Explosion"):Clone()
local hrp = character:FindFirstChild("HumanoidRootPart")
beam.Parent = workspace
beam.CFrame = hrp.CFrame * CFrame.new(2,0,-2)
game.Debris:AddItem(beam, 5)
local bv = Instance.new("BodyVelocity", beam)
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = CFrame.new(beam.Position, Value2).lookVector * 100
beam.Touched:Connect(function(hit)
if hit.Parent.Name == Player.Name then return end
if hit.Parent:FindFirstChild("Humanoid") then
--explosion.Position = beam.Position
explosion:SetPrimaryPartCFrame(beam.CFrame)
explosion.PrimaryPart.Anchored = true
beam:Destroy()
explosion.Parent = workspace
game.Debris:AddItem(explosion,2)
local TweenService = game:GetService("TweenService")
local innerbeam = game:GetService("ReplicatedStorage"):FindFirstChild("Explosion"):WaitForChild("InnerExplosion")
TweenService:Create(explosion.PrimaryPart, TweenInfo.new(2, Enum.EasingStyle.Linear), { Size = Vector3.new(15,15,15) }):Play()
TweenService:Create(innerbeam, TweenInfo.new(3, Enum.EasingStyle.Linear), { Size = Vector3.new(13,13,13) }):Play()
the innerpart wont tween in the first run, but it will stay in Vector3.new(13,13,13) in the second use of the beam