So what I am trying to do is if a Player goes AFK an animation would play. However when I run the code I get no errors.
local GH = require(game.ReplicatedStorage.Modules.GameHandler)
game.ReplicatedStorage.Remotes.Gameplay.OnServerEvent:Connect(function(player, Action, Object, Object2)
if Action == "AFK" then
local Anim = RepStorage.Animations.AFKStanding
if player.Character then
if GH:CheckRig(player.Character) == true then
if Object == true then
player.Character.Head:WaitForChild("Overhead", 10)
player.Character.Head.Overhead.DisplayName.Text = player.DisplayName..[[ <font color="rgb(239, 184, 56)">- AFK -</font>]]
player.Character:FindFirstChild("Humanoid").Animator:loadAnimation(Anim)
elseif Object == false then
player.Character.Head:WaitForChild("Overhead", 10)
player.Character.Head.Overhead.DisplayName.Text = player.DisplayName
end
end
end