#Scripting help

45 messages · Page 1 of 1 (latest)

paper raft
#

Im trying to make a script that can detect what the combo count is and make it so it plays that corresponding animation

#

Dm if you can help so i can show that code on a call or sumthing

spare fog
paper raft
#

task.wait(1)
--This script should first detect an input, then check what character the player is and then do the corresponding animation for that character--
--The m1 script also needs to be the the four different parts where the person can click 4 different times
print("M1Script has loaded")
local UserInputService = game:GetService("UserInputService")

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local combocount = 0
local maxcombo = 4
local Character1 = 1
local Character2 = 2
local Character3 = 3

UserInputService.InputBegan:Connect(function(input)

if input.UserInputType == Enum.UserInputType.MouseButton1 then
combocount = combocount + 1
if combocount = 1 then

            end
        print("Character1 m1 has been clicked")
        local Anim1 = Instance.new("Animation")
        local Anim2 = Instance.new("Animation")
        local Anim3 = Instance.new("Animation")
        local Anim4 = Instance.new("Animation")
        Anim1.AnimationId = "rbxassetid://111272327453748"
        Anim2.AnimationId = "rbxassetid://112855633948801"
        Anim3.AnimationId = "rbxassetid://115525792006095"
        Anim4.AnimationId = "rbxassetid://73309449659534"
        
        
        
        
        
        local PlayAnim = character.Humanoid:LoadAnimation(Anim1)
        PlayAnim:Play()
        task.wait(0.5)
    end
end)
tall lark
#

Holy space

spare fog
#

for future questions, format it like this

task.wait(1)
--This script should first detect an input, then check what character the player is and then do the corresponding animation for that character--
--The m1 script also needs to be the the four different parts where the person can click 4 different times
print("M1Script has loaded")
local UserInputService = game:GetService("UserInputService")

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local combocount = 0
local maxcombo = 4
local Character1 = 1
local Character2 = 2
local Character3 = 3



UserInputService.InputBegan:Connect(function(input)


if input.UserInputType == Enum.UserInputType.MouseButton1 then
            combocount = combocount + 1
                if combocount = 1 then

                end
            print("Character1 m1 has been clicked")
            local Anim1 = Instance.new("Animation")
            local Anim2 = Instance.new("Animation")
            local Anim3 = Instance.new("Animation")
            local Anim4 = Instance.new("Animation")
            Anim1.AnimationId = "rbxassetid://111272327453748"
            Anim2.AnimationId = "rbxassetid://112855633948801"
            Anim3.AnimationId = "rbxassetid://115525792006095"
            Anim4.AnimationId = "rbxassetid://73309449659534"

            local PlayAnim = character.Humanoid:LoadAnimation(Anim1)
            PlayAnim:Play()
            task.wait(0.5)
        end
    end) 
spare fog
#

i just woke up bro 😭

tall lark
#

You can right-click a message and press copy text

#

It'll also copy the formatting, so see it for yourself

spare fog
#

my discord crashed

paper raft
#

ok

#

i see

tall lark
paper raft
#

but i still help creating the script

#

for that part i need

spare fog
spare fog
#

why are you creating a new animation every single time someone presses m1

paper raft
#

i was gonna change that

#

i have it set up

#

just gonna get the script to atleast work

#

before i do it

spare fog
#

whatever a simple solution is :LoadAnimation(PunchAnims[combocount])

#

and place the

#

animations in a table called PunchAnims

tall lark
#

Preferably load them beforehand

spare fog
#

of course

#

my brain is barely working

#

maybe i shouldnt help people so early

#

😭

paper raft
#

can we go in a call bc im a little lost?

spare fog
#

im hopping off now

paper raft
#

ight

#

do u know anyone who can help?

spare fog
#

queln

tall lark
#

no

paper raft
#

dam