Advertisement
TheUnknownDiscord

grab remake

Oct 4th, 2021 (edited)
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.95 KB | None | 0 0
  1. NLS([[
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  3. local E = ReplicatedStorage:WaitForChild("ELol")
  4. local mouse = owner:GetMouse()
  5. local target
  6. local down
  7. local cursor = Instance.new("Part", owner.Character)
  8. cursor.Size = Vector3.new(0.1,0.1,0.1)
  9. cursor.Anchored = true
  10. cursor.Transparency = 1
  11. local attachment0 = Instance.new("Attachment")
  12. attachment0.Parent = cursor
  13. local attachment1 = Instance.new("Attachment")
  14. attachment1.Parent = cursor
  15. alignposition = Instance.new("AlignPosition")
  16. alignposition.Parent = cursor
  17. alignposition.Attachment0 = attachment0
  18. alignposition.Attachment1 = attachment1
  19. alignposition.RigidityEnabled = true
  20. attachment0.Visible = false
  21. mouse.Button1Down:connect(function()
  22. if mouse.Target ~= nil then
  23. target = mouse.Target
  24. down = true
  25. attachment0.Parent = target
  26. task.wait()
  27. attachment0.WorldCFrame = mouse.Hit
  28. attachment0.Visible = true
  29. task.wait()
  30. local Model = target:FindFirstAncestorOfClass("Model")
  31. if Model then
  32. mouse.TargetFilter = Model
  33. else
  34. mouse.TargetFilter = target
  35. end
  36. task.wait()
  37. E:FireServer(target, down, mouse.Hit)
  38. end
  39. end)
  40.  
  41. game:GetService("RunService").RenderStepped:Connect(function()
  42. cursor.Position = game.Workspace.CurrentCamera.CFrame.Position + (mouse.Hit.Position - game.Workspace.CurrentCamera.CFrame.Position).Unit * 20 + Vector3.new(0,0.1,0)
  43. end)
  44. mouse.Button1Up:connect(function()
  45. down = false
  46. task.wait()
  47. E:FireServer(target, down, mouse.Hit)
  48. wait()
  49. target = nil
  50. mouse.TargetFilter = nil
  51. attachment0.WorldCFrame = cursor.CFrame
  52. attachment0.Parent = cursor
  53. attachment0.Visible = false
  54. end)
  55. ]],owner.PlayerGui)
  56. local attachment0 = Instance.new("Attachment")
  57. attachment0.Parent = owner.Character.Head
  58. local attachment1 = Instance.new("Attachment")
  59. attachment1.Parent = owner.Character.Head
  60. local beam = Instance.new("Beam")
  61. beam.Attachment0 = attachment0
  62. beam.Attachment1 = attachment1
  63. beam.CurveSize0 = 2 -- create a curved beam
  64. beam.CurveSize1 = -2 -- create a curved beam
  65. beam.FaceCamera = true -- beam is visible from every angle
  66. beam.Segments = 10 -- default curve resolution
  67. beam.Width0 = 1 -- starts small
  68. beam.Width1 = 1
  69. beam.Enabled = false
  70. beam.Parent = attachment0
  71. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  72. local E= Instance.new("RemoteEvent", ReplicatedStorage)
  73. E.Name = "ELol"
  74. local PC
  75. local Model
  76. local who
  77. local oldplat
  78. local function where(player, target, down,hitp)
  79. pcall(function()
  80. if target.Name ~= "Base" then
  81. if down then
  82. who = target
  83. beam.Enabled = true
  84. attachment0.Parent = who
  85. attachment0.WorldCFrame = hitp
  86. Model = who:FindFirstAncestorOfClass("Model")
  87. if Model then
  88. PC = game:GetService("Players"):GetPlayerFromCharacter(Model)
  89. if PC then
  90. task.wait()
  91. oldplat = PC.Character.Humanoid.PlatformStand
  92. PC.Character.Humanoid.PlatformStand = true
  93. for i,v in pairs(PC.Character:GetDescendants()) do
  94. pcall(function()
  95. v:SetNetworkOwner(owner)
  96. end)
  97. end
  98. else
  99. for i,v in pairs(Model:GetDescendants()) do
  100. pcall(function()
  101. v:SetNetworkOwner(owner)
  102. end)
  103. end
  104. end
  105. else
  106. who:SetNetworkOwner(owner)
  107. for i,v in pairs(who:GetDescendants()) do
  108. pcall(function()
  109. v:SetNetworkOwner(owner)
  110. end)
  111. end
  112. end
  113. elseif not down then
  114. beam.Enabled = false
  115. attachment0.Parent = owner.Character.Head
  116. task.wait()
  117. if PC then
  118. PC.Character.Humanoid.PlatformStand = oldplat
  119. for i,v in pairs(PC.Character:GetDescendants()) do
  120. pcall(function()
  121. v:SetNetworkOwner(PC)
  122. end)
  123. end
  124. elseif Model and not PC then
  125. for i,v in pairs(Model:GetDescendants()) do
  126. pcall(function()
  127. v:SetNetworkOwner(owner)
  128. end)
  129. end
  130. elseif not Model and not PC then
  131. who:SetNetworkOwner(owner)
  132. for i,v in pairs(who:GetDescendants()) do
  133. pcall(function()
  134. v:SetNetworkOwner(owner)
  135. end)
  136. end
  137. end
  138. end
  139. end
  140. end)
  141. end
  142. E.OnServerEvent:Connect(where)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement