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 an emote for a tool?

Ive tried making an emote tool, similar to the "tumbling tools" seen in studio, and i can get it into my game as an e/ emote, but not as a tool where I can click it and it will play. Could anyone help me with this, or give me a script for it?

1 comment

0

I'll try to give you an answer as soon as possible, can't right now though as I am unable to test scripts currently due to not being near my PC.

1 answer

If i am right you want to tool, and when you equip it you dance, if yes then here is how you can do that:

Make a tool, put it into starter pack and put local script into it, then put the animation you need somewhere, make sure to set these tool's properties: CanBeDropped = false RequiresHandle = false ManualActivationOnly = true -- i have no idea what is this but i have set it to true

And here is script with explanation, if you don't need something there, just remove it

local animation = script:WaitForChild("CHICKEN") -- animation you want to play, you can put it anywhere you want, i reccomend putting it into the script, would be easier
local tool = script.Parent -- what is your tool
local player =  game.Players.LocalPlayer -- our player
local character = player.Character or player.CharacterAppearanceLoaded:Wait() -- if character then ok, else it waits for character to load
local humanoid = character:WaitForChild("Humanoid") -- Waits for player's humanoid
local loaded_animation -- this is nil value, but we will need it to use in 2 functions, if you would 
-- write it in the first function, you would not be able to use it in the second one as it is local variable

local speed = 1 -- How fast will the animation play

tool.Equipped:Connect(function() -- When tool is equipped
	loaded_animation = humanoid:LoadAnimation(animation) -- It will load our animation
	loaded_animation:Play() -- And play it
	loaded_animation:AdjustSpeed(speed) -- If you want to adjust speed, it will set the speed just like we set in line 9, never put it before :Play() as that function sets the speed to 1
	-- humanoid.WalkSpeed = 0
	-- humanoid.JumpPower = 0 -- Just in case you want player to not be able to walk and move
end)

tool.Unequipped:Connect(function()
	-- humanoid.WalkSpeed = 16
	-- humanoid.JumpPower = 50 -- Just in case you want player to not be able to walk and move
	loaded_animation:Stop() -- Stops the animation when the tool is unquipped
end)

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