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

How Can I Make My Own "/e" Animations for Players?

Asked by 4 years ago

I know lots of games have their own animations when you type something in the chat preceded by "/e". (or maybe it's /c...). Is there an easy way for me to bind an animation to whenever a player types "/e ANIMNAME", where ANIMNAME is any string I want?

0
If you would like to do it that way, my solution is to use the string library and find a pattern that’s able to read the ANIMNAME separately from the rest of the string. SmartNode 383 — 4y
0
You can read about changing the default /e animations here, as well as changing any other types of default animations https://developer.roblox.com/en-us/articles/using-animations-in-games Psudar 882 — 4y

1 answer

Log in to vote
0
Answered by
Lucke0051 165
4 years ago
Edited 4 years ago

I made a script:

local anim = game:GetService("ReplicatedStorage"):WaitForChild("Animation") --where your animation is
local text = "/e justice" --what to say

game.Players.PlayerAdded:Connect(function(plr)
    plr.Chatted:Connect(function(msg)
        local pmsg = msg:lower()
        if pmsg == text then
            if plr.Character then
                local a = plr.Character.Humanoid:LoadAnimation(anim)
                a:Play()
            end
        end
    end)
end)

I put the animation in ReplicatedStorage, this does though show the Roblox messages saying you cant use this animation. It does still work, I'm not sure how to get rid of that message.

Here is a GIF of it: https://gyazo.com/712b31bae8d01d4781a60d4c9a578249

Basically what this does is first of all waiting for player to be added, then if they chat we take the message and convert it to lower letters so this works even when you have upper-/lowercase letters. Then we just check for they character and then plays the animation.

0
For whatever reason, this doesn't work for me. It does give me that error message in the chat, but still doesn't play. corncob567 275 — 4y
0
Did you add the animation and change the local anim to wherever the animation is? And make sure you put a animation id in it. (Btw you can't use someone else's animation) Lucke0051 165 — 4y
0
Did you put this in a localscript or serverscript (this is a serverscript) Lucke0051 165 — 4y
Ad

Answer this question