Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I go about cloning the character into lighting?

This is the code I currently have, I am trying to put the character into a module3d gui, to make a shop gui sort of thing, but how would I go about cloning the parts, the shirt/pants, and the accessories?

wait(3)
module3D = require(script.parent.Module3D)
frame = script.Parent.Frame
player1 = game.Players.LocalPlayer:FindFirstChild("Character")
guy = game.Players.LocalPlayer.Character:Clone()
guy.Parent = game.ReplicatedStorage
for _,child in pairs(guy:GetChildren()) do
if child:IsA("Part") then
	child.archivable = true
	child.Anchored=true
model3D = module3D:Attach3D(frame,guy)
model3D:SetActive(true)

--[[game:GetService("RunService").RenderStepped:connect(function()
	local fullRotation = math.pi*2
	local currentRotation = tick()%fullRotation
	model3D:SetCFrame(CFrame.Angles(0,currentRotation,0))
end)]]
end
end

1 comment

0

If you're storing anything away, you should use ServerStorage or ReplicatedStorage. Putting anything that isn't lighting related into the LightingService is a deprecated method as the two services are a better option.

1 answer

If it's in a local script just do this

local c = game.Players.LocalPlayer.Character:Clone()
c.Parent = game.Lighting

This discussion is preserved as it was. New answers, comments, and votes are closed.