#Reset Avatar Code

17 messages · Page 1 of 1 (latest)

faint sigil
#

try doing player:LoadCharacter()

#

can you paste the local script here please? start and end the code in ```

#

oh

quartz shell
#

put this into ur localscript:

local button = script.Parent

button.MouseButton1Click:Connect(function()
    game.ReplicatedStorage:WaitForChild("RefreshAvatarEvent"):FireServer()
end)

Make a RemoteEvent in ReplicatedStorage called "RefreshAvatarEvent"

and make a script in ServerScriptService and enter this script:

local refreshEvent = game.ReplicatedStorage:WaitForChild("RefreshAvatarEvent")

local function refreshAvatar(player)
    local char = player.Character
    if char then
        player:LoadCharacter()
    end
end

refreshEvent.OnServerEvent:Connect(refreshAvatar)
faint sigil
#

also put player.CharacterAppearanceId = player.UserId above player:LoadCharacter()

#

thats meant to happen but to make it go back to where you were its more complex

quartz shell
#

u want the character to stay at the current position?

fluid phoenixBOT
#

studio** You are now Level 4! **studio

quartz shell
#
local refreshEvent = game.ReplicatedStorage:WaitForChild("RefreshAvatarEvent")

local function refreshAvatar(player)
    local character = player.Character
    if character then
        local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
        if humanoidRootPart then
            local originalPosition = humanoidRootPart.Position
            local originalOrientation = humanoidRootPart.Orientation

            player:LoadCharacter()

            local newCharacter = player.Character or player.CharacterAdded:Wait()
            local newHumanoidRootPart = newCharacter:WaitForChild("HumanoidRootPart")

            newHumanoidRootPart.CFrame = CFrame.new(originalPosition) * CFrame.Angles(math.rad(originalOrientation.X), math.rad(originalOrientation.Y), math.rad(originalOrientation.Z))
        end
    end
end

refreshEvent.OnServerEvent:Connect(refreshAvatar)
fluid phoenixBOT
#

studio** You are now Level 1! **studio

quartz shell
#

^ServerScript

#

no put it in the serverscript

#

ok wait

quartz shell
#

im to dumb for that lol

#

i tried

#

🥲