Empty
Empty
Empty
Les Scripts de Personnage de Départ sont des conteneurs qui contiennent des scripts automatiquement ajoutés au modèle de personnage de chaque joueur lorsqu'ils apparaissent.
Empty
Empty
Empty
Les scripts ici modifient généralement le personnage du joueur, comme changer les mécaniques de mouvement, ajouter des capacités spéciales ou modifier l'apparence et le comportement du personnage.
Empty
Empty
Empty
-- StarterCharacterScripts > CustomJumpScript
local ContentProvider = game:GetService("ContentProvider")
local function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid")
local jumpAnimation = Instance.new("Animation")
jumpAnimation.AnimationId = "rbxassetid://97611958527430"
-- Preload the animation to check if it exists
local success, errorMessage = pcall(function()
ContentProvider:PreloadAsync({jumpAnimation})
end)
if success then
print("Animation asset exists and has been preloaded successfully.")
local animationTrack = humanoid:LoadAnimation(jumpAnimation)
animationTrack.Priority = Enum.AnimationPriority.Action -- Set the priority on the AnimationTrack
local function playCustomJump()
animationTrack:Play()
end
humanoid.Jumping:Connect(playCustomJump)
else
warn("Failed to load animation asset: " .. errorMessage)
end
end
local player = game.Players.LocalPlayer
player.CharacterAdded:Connect(onCharacterAdded)
if player.Character then
onCharacterAdded(player.Character)
end
Si ce tutoriel vous a été utile et que vous souhaitez soutenir mon travail, veuillez envisager de m'offrir un café.
Merci beaucoup pour votre soutien !
M'offrir un café