Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I go about cloning the character into lighting?

Asked by 6 years ago

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
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. Troidit 253 — 6y

1 answer

Log in to vote
0
Answered by
Viking359 161
6 years ago

If it's in a local script just do this

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

Answer this question