i tried doing in starter player local script code:
local UserInputService = game:GetService("UserInputService")
local part = game.Workspace.Part
local JumpAnimation = script.JumpAnimation
local player = game.Players.LocalPlayer local char = player.Character
local hum = char.Humanoid
local JumpAnimationTrack = hum:LoadAnimation(JumpAnimation) local animation = game.StarterPlayer.StarterPlayerScripts.Animation
UserInputService.InputBegan:Connect(function(input,gameProcessedEvent) if input.KeyCode == Enum.KeyCode.G then JumpAnimationTrack:Play()
1 | end |
2 | end ) |
also local script for animation
local JumpAnimation = script.JumpAnimation
local player = game.Players.LocalPlayer local char = player.Character local hum = char.Humanoid
local JumpAnimationTrack = hum:LoadAnimation(JumpAnimation)
JumpAnimationTrack:Play()
any way to get it working?
idk i dont use animations e.e think this is how
01 | local UserInputService = game:GetService( "UserInputService" ) |
02 |
03 | local part = game.Workspace.Part |
04 |
05 | local JumpAnimation = script.JumpAnimation |
06 |
07 | local player = game.Players.LocalPlayer local char = player.Character |
08 |
09 | local hum = char.Humanoid |
10 |
11 | UserInputService.InputBegan:Connect( function (input,gameProcessedEvent) |
12 | if gameProcessedEvent then |
13 | return |
14 | end |
15 |
16 | if input.KeyCode = = Enum.KeyCode.G then |
17 | JumpAnimation:Play() |
18 | end |
19 | end ) |
Instead of using
1 | char.Humanoid |
You have to use
1 | char:WaitForChild( "Humanoid" ) |
WaitForChild is important for getting characters Properties.
add a screen gui into starter gui. then rename it Emotes! put in a frame into the emotes. name it what you want. put in a text button into the frame. add a local script. the local script says local script:
01 | local emote = name -- replace emote with the name of the emote |
02 | local btn = script.Parent |
03 | local plr = game.Players.LocalPlayer |
04 | local char = plr.Character or plr.CharacterAdded:Wait() |
05 | local hum = char:WaitForChild( "Humanoid" , 10 ) |
06 | local CanEmote = true |
07 | local CoolDown = 1 |
08 |
09 | btn.MouseButton 1 Click:Connect( function () |
10 | if CanEmote = = true then |
11 | CanEmote = false |
12 | local dance = hum:LoadAnimation(script:FindFirstChild(emote)) |
13 | dance:Play() |
14 |
15 | wait(CoolDown + dance.Length) |
16 | CanEmote = true |
17 | end |
18 | end ) |
after that place down a animation into the local script. put in the emote id through the property's tab! do not forget to rename the animation to the emote you puted into the script at local emote = name!