i have a lot of trouble with remote events, and i'm making a equip animation for a gun, can you guys correct me pls??
local player = game:GetService("Players").LocalPlayer local equip_anima = script.Parent:WaitForChild("Equip") equip_anima.OnServerEvent:Connect(function() local animaequip = equip_anima:WaitForChild("Equiping") local animaequiptrack = player.Character:WaitForChild("Humanoid"):LoadAnimation(animaequip) animaequiptrack:Play() end)
If this is an animation for a thing such as a tool, for example, you don't need to use RemoteEvents to play an animation client-sided. Below, is a simplified client-sided animation player:
local player = game:GetService("Players").LocalPlayer local equipAnim = script.Parent:WaitForChild("Equip"):WaitForChild("Equiping") local equipTrack = player.Character:WaitForChild("Humanoid"):LoadAnimation(equipAnim) equipTrack:Play()
If you need any other help, just reply to this answer. :)
-Crystal