HowToRoblox

PetGiver

Aug 22nd, 2020
898
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. game.Players.PlayerAdded:Connect(function(plr)
  2.    
  3.     plr.CharacterAdded:Connect(function(char)
  4.        
  5.         local hrp = char:WaitForChild("HumanoidRootPart")
  6.        
  7.        
  8.         local petClone = script.Pet:Clone()
  9.        
  10.        
  11.         local bodyPos = Instance.new("BodyPosition")
  12.         bodyPos.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  13.         bodyPos.Parent = petClone.MainPart
  14.        
  15.         local bodyGyro = Instance.new("BodyGyro")
  16.         bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  17.         bodyGyro.Parent = petClone.MainPart
  18.        
  19.        
  20.         petClone.Parent = char
  21.        
  22.         wait()
  23.         petClone.MainPart:SetNetworkOwner(plr)
  24.     end)
  25. end)
Add Comment
Please, Sign In to add comment