im trying to make a script that changes player body to a "monster like" depending on the race, there is 4 of these monsters, each one with a specific body, i did it with a ServerScript and doing this:
if race.Value == "hollow" then local newChar = hollow:Clone() newChar.Name = plr.Name newChar.Parent = W newChar.PrimaryPart = newChar.HumanoidRootPart newChar.PrimaryPart.CFrame = plr.Character.PrimaryPart.CFrame plr.Character = newChar game.ReplicatedStorage:WaitForChild("CameraFix"):FireClient(plr) end
its the best way? make in a ServerScript and do all these things or theres a way to just change the player "StarterCharacter"? i think in a LocaScript, something like "if your race is X, ill clone the X body in your StarterPlayer and rename it StarterCharacter" what u guys think about it?
I'm no expert at all, but I would probably put the monster bodies in something like replicated storage or whatever, and run something like this:
if race.Value ~= nil then local body = game.ReplicatedStorage:FindFirstChild(Race.Value):Clone() body.Parent = newChar --everything else blah blah print("Mwahaha you are now a... "..race.Value.."!!!")
That way you aren't running numerous "if race.Value == this, and if race.Value == that", etc.