Just wondering what I did wrong? it gives this error: 13:24:32.380 - Workspace.Script:6: attempt to call method 'Clone' (a nil value) If I dont use the pname and put my name in it works fine.
local pname = game.Players.LocalPlayer print (pname) local ch = game.Workspace.pname:Clone() ch.Name = "character" ..name ch.Parent = game.Lighting
thanks for helping anyways.
-- I know what u want so here: -- Put all this in localscript local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local NewCharacter = Instance.new('Model',game.ServerStorage) NewCharacter.Name = 'Character: ' ..Character.Name for i,v in pairs(Character:GetChildren()) do local NewItem = v:Clone() NewItem.Parent = NewCharacter end
When using LocalPlayer it needs to be in a LocalScript. Also, for some reason you cannot clone the player model because I think by default it's Archivable value is set to false so you can make a for loop to go through and clone everything inside the player model. Here is my version of your code though that does work:
wait(1) -- Need to wait or else you'll get the nil error local players = game:GetService("Players") local p = players:WaitForChild("PlayerName") local plrName = tostring(p) print (plrName) local m = Instance.new("Model", game.Lighting) -- Model holding your player --For loop that clones everything inside player and then parents it to the Model we made named "m" for _, v in pairs(p.Character:GetChildren()) do v:Clone().Parent = m end m.Name = "Character"..plrName m:MakeJoints()
I hope this helped.