So, you need to fire RemoteEvent from client to server?
In that case, you need to fire RemoteEvent and setting which exact client will fire it but you made an mistake while firing it.
Make sure that you have a player to fire Remote Event from a client!
local attack = script.Animation
local attackAnim = script.Parent.Animator:LoadAnimation(attack)
local player = game:GetService("Players"):GetPlayers()[1] -- there is suppose to be a player but i have just used GetPlayers and returned one player that contains in GetPlayers table. anyway feel free to change the variable!
game.ReplicatedStorage.Remotes:WaitForChild("playerDeath").OnServerEvent:Connect(function(player)
print("detected")
attackAnim:Play()
end)
it seems that the issue is that nothing is receiving the remote event, however, the script firing it looks fine
server script:
local player = game.Players:GetPlayerFromCharacter(target)
game.ReplicatedStorage.Remotes:WaitForChild("playerDeath"):FireClient(player)
print("d1")
then the local script (which should receive it and fire another event to the server) doesnt receive it for some reason
local script:
game.ReplicatedStorage.Remotes:WaitForChild(“playerDeath”).OnServerEvent:Connect(function(player)
print(“d2”)
game.ReplicatedStorage.Remotes:WaitForChild(“j1”):FireServer(player)
end)
Is the animation controller inside a model? Also, try doing AnimationController:LoadAnimation(yourAnim) and delete the Animator inside the controller. You can’t fire an event on the server and try to get the data on a serverscript. Events can only communicate between server - client. Not server - server!
It worked just fine for me. Might be the way you are collecting the character’s death! PS I CHANGED THE LOCATION OF THE REMOTES SO CHANGE THEM TO YOURS