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

Sword swing different every swing script help? [closed]

Asked by
sho17 -15
7 years ago

I'm not really a scripter but an animator, but I have a problem. I animated 3 type of sword swings and i want to place them in order like a combo every time you click. Anyone know how to script that?

Closed as Not Constructive by minikitkat

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
oSyM8V3N 429 Moderation Voter
7 years ago

Yes. You can user the UserInputService by doing this :

local UIS = game:GetService("UserInputService")
chain = 0

Then you can make it so if the player clicks the left mouse it will play whatever you tell it to. Here's an example :

UIS.InputBegan:connect(function(input, gameProcessedEvent)
    if not gameProcessedEvent then
        if input.UserInputType == Enum.UserInputType.MouseButton1 and chain == 0 then
chain = 1
--Do your stuff here--
else
if input.UserInputType == Enum.UserInputType.MouseButton1 and chain == 1 then
chain = 2
--Do your stuff here
            print('Left Mouse Button Press')
            --insert code here
        end
    end
end
end)

And so on.

If you want a better example, please comment

Ad