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

Best way to clone a package to the player?

Asked by 8 years ago

I'm trying to get a package I placed in ServerStorage to clone to the Player's character model. I tried using :Clone(), but that doesn't seem to work.

--Setup--
wait()

local MrGrey = game.ServerStorage.MrGrey
------------------------------------------
game.Players.PlayerAdded:connect(function(ChangeAppear)
    game.ServerStorage.MrGrey:Clone().Parent = game.Players.LocalPlayer.Character
end)
0
Is this a Script in either the Workspace or ServerScriptService? (If not, it needs to be.) Also, if you're going to have line 4, you might as well use that variable on line 7 ["MrGrey:Clone()" instead of "game.ServerStorage.MrGrey:Clone()"] (this won't fix your problem, however) chess123mate 5873 — 8y
0
No. Raven_Caedes 95 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago

Try putting the model in ReplicatedStorage; if that does not work, then put it in Lighting.

Ad
Log in to vote
0
Answered by 8 years ago

So what I would do is this:

 -- No wait cause that actually pauses your script
local MrGrey = game.ServerStorage.MrGrey:clone()

game.Players.PlayerAdded:connect(function(player) -- The function PlayerAdded
    player.CharacterAdded:connect(function(char) -- The function CharacterAdded
        MrGrey.Parent = char -- Making the parent the character
    end) -- Ends char function
end) -- Ends player function

Please accept if this works. Thank you!

Answer this question