Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RunService = game:GetService("RunService")
- local Players = game:GetService("Players")
- RunService.Heartbeat:Connect(function()
- for _, Player in ipairs(Players:GetPlayers()) do
- local Character = Player.Character
- if not Character then continue end
- local HRP = Character:FindFirstChild("HumanoidRootPart")
- if not HRP then continue end
- local Pet = workspace:FindFirstChild(Player.Name .. "_Pet")
- if not Pet then continue end
- local Root = Pet.Root
- if not Root then
- warn(Pet.Name .. " no tiene PrimaryPart")
- continue
- end
- local TargetPosition =
- HRP.Position
- - HRP.CFrame.LookVector * 4
- + Vector3.new(0,2,0)
- Pet:PivotTo(CFrame.new(TargetPosition))
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment