also can u add altplayer4 and his head is going to match rotation and position of…
- User
also can u add altplayer4 and his head is going to match rotation and position of altplayer2 torso while being 2 studs more down relative to altplayer2 torso?
- Assistant
Certainly! To clarify, you're working in Roblox and you have at least two characters or models:
altplayer2andaltplayer4. You want to:- Add
altplayer4(assuming adding its model to the workspace or your scene). - Make
altplayer4's head copy the rotation and position ofaltplayer2's torso. - But
altplayer4's head should be 2 studs lower relative to 's torso (i.e., shifted down along the Y-axis by 2 studs).
- Add
- User
and also can u add altplayer5 that will do the same as altplayer4 but he going to match position and rotation of altplayer3 torso
- Assistant
Certainly! Here's how you can add
altplayer5so that its head matches the position and rotation ofaltplayer3's torso, but also offset 2 studs down likealtplayer4does withaltplayer2.
Complete script snippet including both
altplayer4andaltplayer5:local RunService = game:GetService("RunService") local altplayer2 = workspace:WaitForChild("altplayer2") local altplayer3 = workspace:WaitForChild("altplayer3") local altplayer4 = workspace:WaitForChild("altplayer4") local altplayer5 = workspace:WaitForChild("altplayer5") local torso2 = altplayer2:WaitForChild("Torso") -- or "UpperTorso" if R15 rigs local torso3 = altplayer3:WaitForChild("Torso") local head4 = altplayer4:WaitForChild("Head") local head5 = altplayer5:WaitForChild("Head") RunService.Heartbeat:Connect(function() -- For altplayer4 head matching altplayer2 torso with 2 studs down offset local cframe2 = torso2.CFrame * CFrame.new(0, -2, 0) head4.CFrame = cframe2 -- For altplayer5 head matching altplayer3 torso with 2 studs down offset local cframe3 = torso3.CFrame * CFrame.new(0, -2, 0) head5.CFrame = cframe3 end) - User
and can u provide me fullscript whit altplayer4 and altplayer5 added and their functionalities too
- Assistant
- User
but i already have altplayer4 and 5 in workspace
- Assistant
Got it! Since
altplayer4andaltplayer5already exist in the workspace, I’ll provide you a full script that simply references all four players (altplayer2,altplayer3,altplayer4, andaltplayer5) and updates the heads ofaltplayer4andaltplayer5each frame:altplayer4’s head matches the rotation and position ofaltplayer2’s torso, offset by 2 studs down.altplayer5’s head matches the rotation and position of ’s torso, offset by 2 studs down.
- User
can you also combine that script u just provided whit this script? local Players = game:GetService("Players") local RunService = game:GetService("RunService")
local specifiedPlayer = Players:FindFirstChild("desktopitemleader") local altPlayer1 = Players:FindFirstChild("desktoptoolbox") local altPlayer2 = Players:FindFirstChild("desktopcardboard") local altPlayer3 = Players:FindFirstChild("minidesktopspeaker")
local function updateAltPlayer1() if specifiedPlayer and specifiedPlayer.Character and altPlayer1 and altPlayer1.Character then local specifiedHRP = specifiedPlayer.Character:FindFirstChild("HumanoidRootPart") local altHRP = altPlayer1.Character:FindFirstChild("HumanoidRootPart")
- Assistant