adicione uma funçao para garantir que esse script funcione corretamente quando  o jogador morre/renasce : local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local SkateEquipEvent = ReplicatedStorage:WaitForChild("SkateEquipEvent")
local SkateUnequipEvent = ReplicatedStorage:WaitForChild("SkateUnequipEvent")

-- IDs das animações (substitua pelos seus IDs reais)
local skateIdleAnimationId = "rbxassetid://75721779864587"  -- Substitua pelo ID da sua animação de parado no skate
local skateMoveAnimationId = "rbxassetid://17363261325"     -- Substitua pelo ID da sua animação de movimento no skate
local skateJumpAnimationId = "rbxassetid://74843696976621"  -- Substitua pelo ID da sua animação de pulo

-- Carregar as animações
local skateIdleAnimation = Instance.new("Animation")
skateIdleAnimation.AnimationId = skateIdleAnimationId

local skateMoveAnimation = Instance.new("Animation")
skateMoveAnimation.AnimationId = skateMoveAnimationId

local skateJumpAnimation = Instance.new("Animation")
skateJumpAnimation.AnimationId = skateJumpAnimationId

local skateIdleTrack
local skateMoveTrack
local skateJumpTrack

local isOnSkate = false
local movedConnection
local stateConnection

-- Armazenar o valor padrão de HipHeight
local defaultHipHeight = humanoid.HipHeight

-- Atualiza as animações com base no estado do jogador
local function updateAnimation()
	if isOnSkate then
		local state = humanoid:GetState()
		if state == Enum.HumanoidStateType.Jumping or state == Enum.HumanoidStateType.Freefall then
			if skateIdleTrack and skateIdleTrack.IsPlaying then
				skateIdleTrack:Stop()
			end
			if skateMoveTrack and skateMoveTrack.IsPlaying then
				skateMoveTrack:Stop()
			end
			if skateJumpTrack and not skateJumpTrack.IsPlaying then
				skateJumpTrack:Play()
			end
		else
			local speed = humanoid.MoveDirection.Magnitude
			if speed > 0 then
				if skateIdleTrack and skateIdleTrack.IsPlaying then
					skateIdleTrack:Stop()
				end
				if skateMoveTrack and not skateMoveTrack.IsPlaying then
					skateMoveTrack:Play()
				end
				if skateJumpTrack and skateJumpTrack.IsPlaying then
					skateJumpTrack:Stop()
				end
			else
				if skateMoveTrack and skateMoveTrack.IsPlaying then
					skateMoveTrack:Stop()
				end
				if skateIdleTrack and not skateIdleTrack.IsPlaying then
					skateIdleTrack:Play()
				end
				if skateJumpTrack and skateJumpTrack.IsPlaying then
					skateJumpTrack:Stop()
				end
			end
		end
	end
end

-- Função para quando o skate é equipado
local function onSkateEquipped()
	if isOnSkate then return end

	isOnSkate = true

	humanoid.WalkSpeed = 25
	humanoid.HipHeight = 2.9

	local animateScript = character:FindFirstChild("Animate")
	if animateScript then
		animateScript.Disabled = true
	end

	for _, track in ipairs(humanoid:GetPlayingAnimationTracks()) do
		track:Stop()
	end

	skateIdleTrack = humanoid:LoadAnimation(skateIdleAnimation)
	skateIdleTrack.Priority = Enum.AnimationPriority.Action4
	skateIdleTrack.Looped = true
	skateIdleTrack:Play()

	skateMoveTrack = humanoid:LoadAnimation(skateMoveAnimation)
	skateMoveTrack.Priority = Enum.AnimationPriority.Action4
	skateMoveTrack.Looped = true

	skateJumpTrack = humanoid:LoadAnimation(skateJumpAnimation)
	skateJumpTrack.Priority = Enum.AnimationPriority.Action4

	movedConnection = humanoid.Running:Connect(function(speed)
		updateAnimation()
	end)
	stateConnection = humanoid.StateChanged:Connect(function(oldState, newState)
		updateAnimation()
	end)
end

-- Função para quando o skate é desequipado
local function onSkateUnequipped()
	if not isOnSkate then return end

	isOnSkate = false

	humanoid.WalkSpeed = 18
	humanoid.HipHeight = defaultHipHeight  -- Restaura o HipHeight para o valor padrão

	if movedConnection then
		movedConnection:Disconnect()
		movedConnection = nil
	end
	if stateConnection then
		stateConnection:Disconnect()
		stateConnection = nil
	end

	if skateIdleTrack and skateIdleTrack.IsPlaying then
		skateIdleTrack:Stop()
	end
	if skateMoveTrack and skateMoveTrack.IsPlaying then
		skateMoveTrack:Stop()
	end
	if skateJumpTrack and skateJumpTrack.IsPlaying then
		skateJumpTrack:Stop()
	end

	local animateScript = character:FindFirstChild("Animate")
	if animateScript then
		animateScript.Disabled = false
	end

	if animateScript then
		wait()
		if humanoid then
			for _, track in ipairs(humanoid:GetPlayingAnimationTracks()) do
				track:Stop()
			end
		end
	end
end

-- Conecta aos eventos remotos
SkateEquipEvent.OnClientEvent:Connect(onSkateEquipped)
SkateUnequipEvent.OnClientEvent:Connect(onSkateUnequipped)