I’d highly recommend storing your server scripts inside ServerScriptService. If you want to get the player’s character, simply use the player parameter that roblox assigns to the player that fired the event.
event.OnServerEvent:Connect(function(player)
local character = player.Character
end)
No. Remote events work fine as long as they are replicated from the server to the client. Workspace is a fine place to put them.
This is a local script in StarterCharacterScripts. StarterCharacterScripts is a fine place to have scripts like this and it wouldn’t work in ServerScriptService anyways.
Can you send the Script that fires the event? Make sure it’s a Script firing your event and a LocalScript (with the code above) receiving the event.
You can check to make sure parts of your code are running with print statements. If a line of code doesn’t seem to be running, try adding print statements before it. If the next one doesn’t run, continue until you find the part that is running.
Are you getting any errors?
This should probably be WaitForChild instead of FindFirstChild
Yeah you’re right. I thought it was a local script because its parent is a player’s character and it plays animations. It definitely would be better to have this in ServerScriptService, that’s my bad.