Beginner developer here, i want to make a script (it’s gonna be a 1 player game) where it spawns a dummy with the same accessories and clothings as the player that joined, how can i achieve this?
I’ve tried different solutions offered here such as getplayerid, but as a beginner, everything is confusing here and i dont really know where to start
It would also help if i got told where i need to store the script (such as in Players folder or another one? thanks
You probably want to use a server script to achieve this, located in ServerScriptService (optimal location for scripts).
You could probably just clone the player’s character, or, if that doesn’t work for some reason, use Players:GetCharacterAppearanceAsync().
local players = game:GetService("Players")
local function playerAdded(player)
local success, response = pcall(
players.GetCharacterAppearanceAsync, players, player.UserId
)
if success then
local newChar = response
else
warn(response)
end
end
players.PlayerAdded:Once(playerAdded)
Try this script that simply clones the player’s character:
local players = game:GetService("Players")
local function playerAdded(player)
local char = player.Character or player.CharacterAdded:Wait()
local animateChar = char:Clone()
-- Do what you will with animateChar
end
players.PlayerAdded:Once(playerAdded)