Roblox

From Virtujoy Documentation
Revision as of 16:03, 6 February 2026 by Timothy (talk | contribs) (Created page with "* [https://create.roblox.com/dashboard/creations https://create.roblox.com/dashboard/creations] * [https://create.roblox.com/settings/eligibility/public-publish https://create.roblox.com/settings/eligibility/public-publish] * [https://create.roblox.com/docs/reference/engine/libraries/task] <syntaxhighlight lang="lua" line> local RunService = game:GetService("RunService") local Character = script.Parent.Parent local HumanoidRootPart = Character:FindFirstChild("HumanoidR...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
local RunService = game:GetService("RunService")
local Character = script.Parent.Parent
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
local pet = script.Parent

local function SetPetCFrame()
	pet.PrimaryPart.CFrame = HumanoidRootPart.CFrame * CFrame.new(2, 2, -3)
end -- Hroot is player's HumanoidRootPart

RunService.Heartbeat:Connect(function()
	wait()
	SetPetCFrame()
end)