Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Press a key to play a animation?

Asked by 3 years ago
Edited 3 years ago

Hey I am making a game and wrote a script to play a emote when you press a key and it does work in studio but in the the game (not in studio test) it dosent work this is my script


local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait() local character = player.Character or player.CharacterAdded:Wait() local Humanoid = character:WaitForChild("Humanoid") local uis = game:GetService('UserInputService') local anim = Instance.new("Animation") anim.AnimationId = "rbxassetid://6712486204" -- bla bla bla bla function onKeyPressed(inputObject,gameProcessEvent) if inputObject.KeyCode == Enum.KeyCode.R then Humanoid:LoadAnimation(anim):Play() print("Animation is playing") end end uis.InputBegan:Connect(onKeyPressed)
0
Is the game made by you or by your group? Animations must be created by same owner as the place to be able to load. imKirda 4491 — 3y
0
by my group well published by my group so should i make the animation published aas my group? kidsteve923 139 — 3y

2 answers

Log in to vote
1
Answered by 3 years ago

Unless there is something wrong with your script, it could be that the animation doesn't belong to your account. If that is the case it is unplayable using your key bind.

You COULD make your own animations using the ROBLOX Animator, or find free ones from the Toolbox and upload those if you find that too difficult. It's a learning process to make super detailed animations and can be a pain sometimes. There's even ways to take other people's animations, like the one seen in your script assuming it doesn't belong to you. It's stealing, I know, but in the end I don't think anyone cares. For more info on this DM me at noboundaries1#6198 on Discord for a full walkthrough.

0
i literally made ALL those animations kidsteve923 139 — 3y
0
i literally made ALL those animations all try the code ur self kidsteve923 139 — 3y
0
we can't try it ourselves in studio and expect it to work if we do not own the animations sean_thecoolman 189 — 3y
0
but u can make animationss ur self kidsteve923 139 — 3y
View all comments (2 more)
0
but u can make animationss ur self kidsteve923 139 — 3y
0
but u can make animationss ur self kidsteve923 139 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

This can be because the animation you want to play is not made by the creator of the game. You cannot play animations made by users who are not the developers of the game.

What you should do instead is recreate the animation on your own. Here is an useful guide on how to animate using the Roblox animation editor. You can also search up for youtube tutorials on how to animate.

0
UMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM i made the animations they dont work in the final game but i made them kidsteve923 139 — 3y

Answer this question