local plr = game.Players.LocalPlayer
local char = plr.Character
local hum = char:WaitForChild("Humanoid")
local shootButton = plr:WaitForChild("ShootButton")
shootButton.MouseButton1Click:Connect(function()
local cam = workspace.CurrentCamera
local targetPos = cam.CFrame.p
local dir = (targetPos - char.PrimaryPart.Position).Unit
local power = 200
for _, part in ipairs(char:GetDescendants()) do
if part:IsA("BasePart") then
part.Velocity = Vector3.new()
part.RotVelocity = Vector3.new()
part.Anchored = true
end
end
char.PrimaryPart.Velocity = dir * power
char.Torso.RotVelocity = Vector3.new(0, math.huge, 0)
for _, joint in ipairs(char.Torso:GetChildren()) do
if joint:IsA("Motor6D") then
joint desirables0 = 0
joint.desirables1 = 0.7853981633974483
joint.desirables2 = 1.5707963705062866
end
end
task.wait(0.2)
for _, part in ipairs(char:GetDescendants()) do
if part:IsA("BasePart") then
part.Anchored = false
end
end
end)
To embed this program on your website, copy the following code and paste it into your website's HTML: