#Changing Character by script

1 messages · Page 1 of 1 (latest)

river rivet
#

smt happens when i destroy 2nd extra humanoid

game.Players.PlayerAdded:Connect(function(player)
print("Changing character for:", player.Name)

player.CharacterAdded:Wait()

local oldchar = player.Character
local newchar = rig:Clone()

newchar.Name = player.Name
newchar.Parent = workspace
player.Character = newchar

local newhum = newchar.Humanoid
local hum = oldchar.Humanoid
hum.Parent = newchar


newhum:Destroy()


if oldchar then
    oldchar:Destroy()
end

print("Character changed successfully for:", player.Name)

end)`

#

when i let 2 humanoid exist it works properly

#

when i destroy other this time camera gets bugged

silk tigerBOT
#

studio** You are now Level 5! **studio

river rivet
paper acorn
#

to clone a character it must have Archivable==true

paper acorn
#

check if your rig has the property Archivable enabled

river rivet
paper acorn
#

also you're tryna set a new humanoid to an existing char which doesnt work

#

so you don't do it like that

river rivet
#

so uh

#

do i destroy char first?

paper acorn
#

why arz you trying to set a new humanoid

river rivet
#

trying to change players character

paper acorn
#

yes

#

but don't mess with humanoid then

river rivet
#

how can i do that without messing with humanoid?

paper acorn
#

because humanoid is a property of character not player

#

it's character you change

river rivet
#

i did player.Character

paper acorn
#

yes but you can't do that when the player is alive

#

so you have to do that while being dead

#

and use loadcharacter

#

it's kinda messy to do

#

but it's how you do

#

znd you have to make camera focus the character

#

on client

river rivet
paper acorn
#

you can't change cameras on server

river rivet
#

my brain isnt braining

lusty widget
#

you can just uh

#

put the rig

#

name it StarterCharacter

#

put it it in starter player

river rivet
#

there will be many characters

lusty widget
#

oh starter pack i forgot

river rivet
#

so player must morh to which character he has

lusty widget
#

oh then it'll be 10 times more confusing mate

river rivet
#

yes

#

its why

#

my problem is camer rn

#

i think

lusty widget
#

uhm

#

im pretty sure theres some way you can change your camera parent to

#

you'll have to figure it out

river rivet
#

where is camera btw? in player or character?

lusty widget
#

weird but yes

river rivet
#

what.

river rivet
lusty widget
#

uh

#

actually

#

good question

#

i think it is

#

but i think workspace.Camera still work on server script

#

doesnt make sense

river rivet
#

YOU SHOLD BE KIDDING ME

#

ARE YOU F

lusty widget
#

what

river rivet
#

IM TRYING TO SOLVE THIS FOR 1 HOURS

lusty widget
#

what did you find

river rivet
#

AND PROBLEM WAS HIP HEIGHT???

lusty widget
#

what

#

cap

river rivet
lusty widget
#

how does camera have anything to do with hip height

river rivet
#

hip height = 10

#

my code was working

lusty widget
#

does it follow camera

river rivet
#

yes

lusty widget
#

thats nice bruh

#

congratulations

river rivet
#

my humanoid trick did the work

#

i cant feel happy

#

T-T

lusty widget
#

what did you do

lusty widget
#

🤯