How can i make my character look up and down using roblox studio's script system
(im a new scripter)
So you want to make your character look up and then down? This is simple. Simply follow the steps below:
Step 1: Create an animation where the player looks up, and then down.
Step 2: Copy the animationId and create an instance which has a classname of "Animation"
Step 3: Paste this Id into the property box that says "AnimationId" and press the enter key
--In this case, we will be using a button to play the animation (when the button is clicked)
Step 4: Insert a ScreenGUI into StarterGUI and insert a TextButton into the ScreenGUI
Step 5: Put the animation instance you created earlier into the TextButton and insert a localscript
Step 6: Copy and Paste this code and insert it into your LocalScript (and read the notes in it)
wait() local Tool = script.Parent local CanEmote = true local Player = game.Players.LocalPlayer local character = Player.Character or Player.CharacterAdded:Wait() local Humanoid = character.Humanoid local Animation = Humanoid:LoadAnimation(Tool.Animation) Tool.MouseButton1Click:Connect(function() if CanEmote then Animation:Play() CanEmote = false wait(1) CanEmote = true end end)
You are done! Just make sure everything is arranged like this:
StarterGui ScreenGui TextButton LocalScript Animation
I hope this helps!
Closed as Not Constructive by Shawnyg
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?