Advertisement
plytalent

force

Jul 14th, 2018
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. plr = game:GetService("Players").LocalPlayer
  2. mouse = plr:GetMouse()
  3. part = nil
  4. bp = nil
  5. particles = nil
  6. mouse.KeyDown:connect(function(key)
  7.     if key == "z" and part == nil then
  8.         plr.Character.Torso.CFrame = CFrame.new(Vector3.new(mouse.hit.p.X,mouse.hit.p.Y+1.5,mouse.hit.p.Z),plr.Character.Torso.CFrame.p)
  9.     elseif key == "x" and plr.Character.Parent == workspace.Camera and part == nil then
  10.         if plr.Character.Torso.Anchored == true then
  11.             for y,t in pairs(plr.Character:GetChildren()) do
  12.                 if t:IsA("Part") then
  13.                     t.Anchored = false
  14.                 end
  15.             end
  16.         else
  17.             for y,t in pairs(plr.Character:GetChildren()) do
  18.                 if t:IsA("Part") then
  19.                     t.Anchored = true
  20.                 end
  21.             end
  22.         end
  23.     elseif key == "c" and plr.Character.Parent == workspace.Camera and part ~= nil then
  24.         local clone = part:Clone()
  25.         clone.Parent = workspace
  26.         clone.Anchored = false
  27.         clone:ClearAllChildren()
  28.         clone.CanCollide = true
  29.         bp.Parent = clone
  30.         particles.Parent = clone
  31.         if part.Parent:FindFirstChildOfClass("Humanoid") then
  32.             part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = false
  33.         end
  34.         part:Destroy()
  35.         part = clone
  36.     end
  37. end)
  38. mouse.Button1Down:connect(function()
  39.     if true then
  40.         if mouse ~= nil then
  41.             if mouse.Target ~= nil then
  42.                 part = mouse.Target
  43.                 bp = Instance.new("BodyPosition",part)
  44.                 bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  45.                 bp.Position = part.Position
  46.                 particles = Instance.new("ParticleEmitter",part)
  47.                 particles.Color = ColorSequence.new(Color3.new(255, 85, 255))
  48.                 particles.Size = NumberSequence.new(1)
  49.                 particles.Texture = "rbxassetid://292289455"
  50.                 particles.VelocitySpread = 0
  51.                 particles.Speed = NumberRange.new(0)
  52.                 particles.RotSpeed = NumberRange.new(0)
  53.                 particles.Rotation = NumberRange.new(0)
  54.                 particles.Rate = 0
  55.                 particles.Lifetime = NumberRange.new(.2,.4)
  56.                 particles.Transparency = NumberSequence.new(1,1)
  57.                 dwn = true
  58.             end
  59.         end
  60.         while dwn == true do
  61.             wait() 
  62.             bp.Position = mouse.hit.p
  63.             if part then
  64.                 if part.Parent:FindFirstChildOfClass("Humanoid") then
  65.                     part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = true
  66.                 end
  67.             end
  68.         end
  69.     end
  70. end)
  71. mouse.Button1Up:connect(function()
  72.     dwn = false
  73.     if part then if part.Parent:FindFirstChildOfClass("Humanoid") then part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = false end part = nil end
  74.     if bp then bp:Destroy() end
  75.     if particles then particles:Destroy() end
  76. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement