eea

grab

eea
Oct 27th, 2021 (edited)
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. local char = owner.Character
  2. local remote = Instance.new("RemoteEvent",game.ReplicatedStorage)
  3. remote.Name = owner.Name
  4.  
  5. function ihopethisworks(playe,otherplaye,grass)
  6. while wait() do
  7. if grass then
  8. otherplaye.HumanoidRootPart.Position = playe.Character.HumanoidRootPart.CFrame.LookVector*5 +
  9. playe.Character.HumanoidRootPart.Position
  10. end
  11. end
  12. end
  13.  
  14. function otherfunction(playe,otherplaye,grass)
  15. while wait() do
  16. if grass then
  17. otherplaye.Torso.Position = playe.Character.HumanoidRootPart.CFrame.LookVector*5 + playe.Character.HumanoidRootPart.Position
  18. end
  19. end
  20. end
  21.  
  22. NLS([[
  23. local mouse = owner:GetMouse()
  24. local char = owner.Character
  25. local grab = true
  26. local is = game:GetService("UserInputService")
  27.  
  28. is.InputBegan:Connect(function(key)
  29. if key.KeyCode == Enum.KeyCode.E then
  30. if grab then
  31. grab = false
  32. game.ReplicatedStorage:FindFirstChild(owner.Name):FireServer(-1,-1,grab)
  33. else
  34. grab = true
  35. game.ReplicatedStorage:FindFirstChild(owner.Name):FireServer(-1,-1,grab)
  36. end
  37. end
  38. end)
  39.  
  40. mouse.Button1Down:Connect(function(m)
  41. if mouse.Target.Parent:FindFirstChild("HumanoidRootPart") then
  42. game.ReplicatedStorage:FindFirstChild(owner.Name):FireServer(mouse.Target.Parent,0,grab)
  43. elseif mouse.Target.Parent:FindFirstChild("Torso") and not mouse.Target:FindFirstChild("HumanoidRootPart") then
  44. game.ReplicatedStorage:FindFirstChild(owner.Name):FireServer(mouse.Target.Parent,1,grab)
  45. end
  46. end)
  47. ]],char)
  48.  
  49. remote.OnServerEvent:Connect(function(player,otherplayer,t,grab)
  50. print("sus")
  51. print(grab)
  52. if t == 0 then
  53. ihopethisworks(player,otherplayer,grab)
  54. end
  55.  
  56. if t == 1 then
  57. otherfunction(player,otherplayer,grab)
  58. end
  59. end)
Add Comment
Please, Sign In to add comment