Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local players = game:GetService("Players")
- local replicatedstorage = game:GetService("ReplicatedStorage")
- local events = replicatedstorage.Events
- repeat wait() until players.LocalPlayer
- local player = players.LocalPlayer
- local char = player.Character
- local mouse = player:GetMouse()
- local currentPart
- function controlPart()
- if not mouse.Target.Anchored then
- currentPart = mouse.Target
- local bp = Instance.new("BodyPosition")
- bp.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- bp.P = 10000
- bp.Parent = currentPart
- while wait() do
- if currentPart ~= nil then
- bp.Position = (mouse.Hit.p - char.Torso.CFrame.p).unit*300
- end
- end
- end
- end
- mouse.KeyDown:connect(function(key)
- if key == "f" then
- controlPart()
- elseif key == "p" then
- currentPart = nil
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement