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

How i can make my character look up and down? (not the weapon question) [closed]

Asked by 5 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

How can i make my character look up and down using roblox studio's script system

(im a new scripter)

0
This question is lacking a lot of information. What do you mean by look up and down. EtherealTrin 45 — 5y

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?

1 answer

Log in to vote
0
Answered by 5 years ago

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!

Ad