HowToRoblox

GunServer

Nov 22nd, 2020
647
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. game.Players.PlayerAdded:Connect(function(plr)         
  2.     plr.CharacterAdded:Connect(function(char)
  3.                
  4.         local M6D = Instance.new("Motor6D")
  5.         M6D.Name = "ToolGrip"
  6.         M6D.Parent = char.UpperTorso
  7.     end)
  8. end)
  9.  
  10. game.ReplicatedStorage.ConnectM6D.OnServerEvent:Connect(function(plr, location)
  11.  
  12.       local char = plr.Character
  13.       char.UpperTorso.ToolGrip.Part0 = char.UpperTorso
  14.       char.UpperTorso.ToolGrip.Part1 = location
  15. end)
  16.  
  17. game.ReplicatedStorage.DisconnectM6D.OnServerEvent:Connect(function(plr)
  18.    
  19.     plr.Character.UpperTorso.ToolGrip.Part1 = nil
  20. end)
RAW Paste Data