I've been learning Roblox this week, and ran into some confusion.
1.) Enemies should spawn from the server on all clients
2.) Enemies should run some code (movement, etc)
3.) ...
4.) Profit
Here's some pseudo-ish code I have:
--Script under ServerScriptService
local storage = game:GetService("ReplicatedStorage")
local enemy = storage:FindFirstChild("Enemy"):Clone()
enemy.Parent = game.Workspace
And just a bit more:
--Script on my 'Enemy'
local humanoid = script.Parent:FindFirstChild("Humanoid")
(...)
humanoid.MoveTo(some location)
(Assume the above all compiles and runs - it's not directly from my project)
What I want (and am not getting) is to have my server script spawn an enemy from ReplicatedStorage when needed for all clients, and for said enemy to run some code. In my case, the enemy spawns but the code does not run. I have FE on, but I was unaware if this had any affect since it's server code, not client.
If you can clear up my confusion and/or suggest a better or more proper way to handle such a task, please let me know at least the basics!
Thanks

2 comments
I was under the impression though that any object created on the server and then placed in the workspace would also be synchronized on clients, isn't this true? I don't need to use any RemoteEvents or Functions because the server is the one requesting to create enemies, I just don't understand why the code on my enemy isn't running on clients (it runs on server), even though they are visible
Yea but the script is being run when the game starts rather than when they spawn so you would use either remote events/ function to initialize a spawn function