My Local Script
wait() local Player = game:GetService("Players").LocalPlayer -- Game gets access to "Players" asset and then takes a local player from it (it's basically the same but more organized). local char = Player.Character local Mouse = Player:GetMouse() local cooldown = 0 local replicatedstorage = game:GetService("ReplicatedStorage") Player.Chatted:Connect(function(message) message = message:lower() if message == "Burn" then game.ReplicatedStorage.Pain:FireServer(3444669792,Mouse.hit) wait(1.62) end end)
My Server Script.
game:GetService("ReplicatedStorage"):FindFirstChild("Pain").OnServerEvent:Connect(function(player,animationID,Mouse) Mouse.Button1Down:Connect(function(hit) local humanoid = Mouse.hit.Parent:FindFirstChild("Humanoid") local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID="..animationID local loadedAnimation = humanoid:LoadAnimation(animation) loadedAnimation:Play() wait(2.65) loadedAnimation:Stop() loadedAnimation:Destroy() end) end)
Not outputting errors, please someone help me and tell me how to fix.