Everything except the bodythrust part works
local db = false
local UIS = game:GetService("UserInputService")
Part = nil
Beam = nil
BT = nil
Releasable = false
script.Parent.Activated:Connect(function()
if not db then
local mouse = game.Players.LocalPlayer:GetMouse()
local newBeam = Instance.new("Beam", script.Parent.Handle)
Beam = newBeam
newBeam.Attachment0 = script.Parent.Handle.Attachment
local newPart = Instance.new("Part", workspace)
Part = newPart
newPart.Transparency = 1
newPart.CanCollide = false
newPart.Anchored = true
newPart.Position = mouse.Hit.Position
local newAttachment = Instance.new("Attachment", newPart)
newBeam.Attachment1 = newAttachment
db = true
wait(.1)
Releasable = true
local BodyThrust = Instance.new("BodyThrust")
BodyThrust.Parent = game.Players.LocalPlayer.Character.HumanoidRootPart
BodyThrust.Force = game.Players.LocalPlayer.Character.Head.CFrame.lookVector * 2
BT = BodyThrust
BodyThrust.Location = mouse.Hit.Position
end
end)
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E and Releasable then
Part:Destroy()
Beam:Destroy()
BT:Destroy()
Beam = nil
Part = nil
db = false
BT = nil
Releasable = false
end
end)
