local repStore = game:GetService(“ReplicatedStorage”)
local remote = repStore:WaitForChild(“ToolStun”)
local plr = game:GetService(“Players”).LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local humanoid = char:WaitForChild(“Humanoid”)
local animation = script:WaitForChild(“Animation”)
local function healthStun()
remote:FireServer(“KbStun”)
end
local function anims(types)
if types == “Stun” then
print(“stun”)
local animTrack = humanoid:LoadAnimation(animation)
animTrack:Play()
elseif types == "StunStop" then
print("Stop")
end
end
humanoid.HealthChanged:Connect(healthStun)
remote.OnClientEvent:Connect(anims)
– out put
17:51:48.239 true - Server - ToolStun:27
17:51:48.272 stun - Client - ToolStun:17
17:51:57.338 Stop - Client - ToolStun:22