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

How do i make someone to perform an animation temporally?

Asked by
Anto3oo 13
3 years ago

Hey guys, let me explain myself, im doing a strenght potion, and when you drink it your body height and widht changes and if you click after that you perform an animation, i do this in a separated script but it does not work ' i've tried changing positions but nothing, so, any fixes? Thank you in advance.

if script.Parent.Parent.Name ~= "Backpack" then
    human = script.Parent.Parent.Humanoid
else if script.Parent.Parent.Name == "Backpack" then
        human = script.Parent.Parent.Parent.Character.Humanoid
    end
end
if human.BodyWidthScale.Value == 2.5 then
    local plr = game.Players.LocalPlayer
    local mouse = plr:GetMouse()
    print(plr)

    mouse.Button1Down:Connect(function()
        wait(1.5)
        print("chupachup")
        end)

by the way i haven't scripted the part where it performs the animation but i'll do that later when this is fixed.

0
What do you mean by temporary? Dehydrocapsaicin 483 — 3y
0
they can only click and perform the animation multiple times for 10 seconds for example Anto3oo 13 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

I think you should put in a "local" because it's a variable like this

if script.Parent.Parent.Name ~= "Backpack" then
    local human = script.Parent.Parent.Humanoid
else if script.Parent.Parent.Name == "Backpack" then
        local human = script.Parent.Parent.Parent.Character.Humanoid
    end
end
if human.BodyWidthScale.Value == 2.5 then
    local plr = game.Players.LocalPlayer
    local mouse = plr:GetMouse()
    print(plr)

    mouse.Button1Down:Connect(function()
        wait(1.5)
        print("chupachup")
        end)
0
it says: unknown global human now Anto3oo 13 — 3y
Ad

Answer this question