You can write your topic however you want, but you need to answer these questions:
What do you want to achieve?
I want to Fire A Server Remote Event to LoadAnimation (i’m trying to make a Emotes)
What is the issue? Include screenshots / videos if possible!
I Have no clue how to realise that…
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I didn’t found something about this problem
and i have the module script to Get the emotes from it:
local EmotesModule = {
SwordHit = {
Animation = script.Animations["Hit"];
Tool = script.Tools["Hit"]:Clone();
Sound = script.Sounds["Hit"];
Looped = true;
EmoteStart = function(character: Model, tool: BasePart)
local hum: Humanoid = character:FindFirstChild("Humanoid");
if character and character:FindFirstChild("Right Arm") then
local weld = Instance.new("Motor6D", tool);
weld.Name = "Hit Motor";
weld.Part0 = tool;
weld.Part1 = character:FindFirstChild("Right Arm");
tool.Parent = character;
end;
if hum then
local animator: Animator = hum:FindFirstChild("Animator");
local track = animator:LoadAnimation(script.Animations.Hit);
track.Looped = true;
track:Play();
end;
end,
EmoteEnd = function(character: Model, tool: BasePart)
if character then
local animator: Animator = character:FindFirstChild("Humanoid").Animator;
for _, track: AnimationTrack in pairs(animator:GetPlayingAnimationTracks()) do
if track.Animation.Name == "Hit" then
track:Stop();
end;
end;
for _, motor6d: Instance in pairs(character:GetDescendants()) do
if motor6d:IsA("Motor6D") and motor6d.Name == "Hit Motor" then
motor6d:Destroy();
end;
end;
tool:Destroy();
end;
end,
}
}
return EmotesModule;
You arent supposed to ask for full scripts, but i’ll give you one anyways.
Local / Client script in StarterCharacterScripts:
cooldown = false
local player = game.Players.LocalPlayer
local humanoid = player.Character.Humanoid
local mouse = player:GetMouse()
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/asset/?id=" --Add your anim ID
mouse.KeyDown:connect(function(key)
if key == "e" then --the key you want the emote to play
if not cooldown then
cooldown = true
local playanim = humanoid:LoadAnimation(animation)
playanim:Play()
wait(0.1)
cooldown = false
end
end
end)
Thanks for trying to help me, but i have the animation with Parts/Items, and i want to Fire Remote Event to set the parent of items to character from server, and i have a ModuleScript for that
local EmotesModule = {
SwordHit = {
Animation = script.Animations["Hit"];
Tool = script.Tools["Hit"]:Clone();
Sound = script.Sounds["Hit"];
Looped = true;
EmoteStart = function(character: Model, tool: BasePart)
local hum: Humanoid = character:FindFirstChild("Humanoid");
if character and character:FindFirstChild("Right Arm") then
local weld = Instance.new("Motor6D", tool);
weld.Name = "Hit Motor";
weld.Part0 = tool;
weld.Part1 = character:FindFirstChild("Right Arm");
tool.Parent = character;
end;
if hum then
local animator: Animator = hum:FindFirstChild("Animator");
local track = animator:LoadAnimation(script.Animations.Hit);
track.Looped = true;
track:Play();
end;
end,
EmoteEnd = function(character: Model, tool: BasePart)
if character then
local animator: Animator = character:FindFirstChild("Humanoid").Animator;
for _, track: AnimationTrack in pairs(animator:GetPlayingAnimationTracks()) do
if track.Animation.Name == "Hit" then
track:Stop();
end;
end;
for _, motor6d: Instance in pairs(character:GetDescendants()) do
if motor6d:IsA("Motor6D") and motor6d.Name == "Hit Motor" then
motor6d:Destroy();
end;
end;
tool:Destroy();
end;
end,
}
}
return EmotesModule;
cooldown = false
local player = game.Players.LocalPlayer
local humanoid = player.Character.Humanoid
local mouse = player:GetMouse()
local RemoteEvent = game.ReplicatedStorage.Emote --Change this to wherever / whatever your remote event is
mouse.KeyDown:connect(function(key)
if key == "e" then --the key you want the emote to play
if not cooldown then
cooldown = true
RemoteEvent:FireServer()
wait(0.1)
cooldown = false
end
end
end)
Insert script inside ServerScriptService and make an Animation inside the script. (If you dont already have a way to load the animation)
Server / Script in ServerScriptService:
local RemoteEvent = game.ReplicatedStorage.Emote
RemoteEvent.OnServerEvent:Connect(function(plr)
local Character = plr.Character
local Humanoid = Character:WaitForChild("Humanoid")
local Anim = script.Animation
local LoadAnim = Humanoid:LoadAnimation(Anim)
LoadAnim:Play()
end)
animations can be loaded and ran from the client, and they will replicate
if exploiters really wanted to abuse your animations, they would just skip the remote tbh
i want to parent the parts to the character, because i have Emote with Parts, and i need an Server Event for that, but i want to make server event that, exploiters don’t abuse it