im making something where when you click a textbutton will revert you back to your old avatar after transforming but for some reason its not working at all? i tried running a print statement to see if the code was even running and it didnt print anything. here is my code
local tool = script.Parent
local debounce = false
local oldchar = game.Players.LocalPlayer.Character
local uis = game:GetService("UserInputService")
tool.Activated:Connect(function(click)
local screen = Instance.new("ScreenGui", game.Players.LocalPlayer.PlayerGui)
local button = Instance.new("TextButton", screen)
button.Position = UDim2.new(0.858, 0,0.337, 0)
button.Size = UDim2.new(0, 200,0, 50)
button.Text = "Revert"
button.TextScaled = true
button.Visible = true
button.Active = true
screen.ResetOnSpawn = false
local Player = game.Players.LocalPlayer
local remote = game.ReplicatedStorage.Change
remote:FireServer()
button.Activated:Connect(function()
print("hi")
local playersService = game:GetService("Players")
local player = game.Players.LocalPlayer
local humDesc = playersService:GetHumanoidDescriptionFromUserId(player.UserId)
game.Workspace.rimuru:Destroy()
player:LoadCharacterWithHumanoidDescription(humDesc)
end)
end)