What I’m trying to find out is how to make custom /e commands play a specific animation and delay walk speed and/or make it impossible to move. I also don’t want the animation to end if I move. So what I’m trying to do is making it if a player say /e hands their hands would go up (like hands up, like you do when someone points a gun at you). I want the wall speed to be slowed down and the animation to still continue even when you walk. I also don’t want the animation to end unless you say /e hands or another /e command after using the /e hands command.
I’m not a scripter so examples and instructions would be appreciated.
So, how do I achieve this?
(I looked quickly over some videos regarding the topic but it was either outdated or not exactly what I wanted)
If you wanted it to end as soon as you start walking, that would be as easy as putting id’s in Roblox’s Animate script.
In your case, you’ll have to script these yourself;
Something like this should work:
local player = game:GetService('Players').LocalPlayer
local emotes = {
hands_up = "rbxassetid://0000"
};
for i,v in pairs(emotes) do
local anim = Instance.new('Animation')
anim.AnimationId = v
emotes[i] = anim
end
player.Chatted:connect(function(message)
if message:sub(1,3) == "/e " then
local emote = message:sub(4)
emote = emotes[emote]
if emote then
if emote.IsPlaying then emote:Stop() else emote:Play() end
end
end
end
There’s a script called “Animate” inside of Roblox’s Character, you could take it, edit it and place it in “StarterPlayerScripts”, or if you’d like, in a local script.
When I use the script you provided the game’s chat turns invisible 5/10 times. But even when it doesn’t the animation doesn’t play after saying /e hands_up.
Please have a look around the DevForum or Developer Hub for answers to some of the questions you posed. Searching “preload” on either website would yield you the answer you need.
It’s quite explicitly documented how to use this. All services are retrieved using GetService, which ContentProvider is. PreloadAsync is a function of ContentProvider which allows preloading. It accepts a table of Instances.
Preloading is irrelevant to this scenario though. Preloading at the beginning of a loop is unnecessary since an asset only needs to be downloaded once and the act of loading was not in reference to preloading, it was readying the Humanoid to use an Animation instance.