Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i make someone to perform an animation temporally?

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.

2 comments

0

What do you mean by temporary?

0

they can only click and perform the animation multiple times for 10 seconds for example

1 answer

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)

1 comment

0

it says: unknown global human now

This discussion is preserved as it was. New answers, comments, and votes are closed.