Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can I Fire from server to an NPC character's script?

Asked by 6 years ago

Hi guys, I've read through the wiki and doesn't seem to find anyway of Firing info from the server to an NPC. Is there anything I've missed out? Are there any way?

1 answer

Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
6 years ago

RemoteEvents and RemoteFunctions can only communicate across the Client | Server boundary.

If you want a Script to send messages to another Script, you can use BindableFunctions or BindableEvents, which are otherwise analogous to RemoteFunctions and RemoteEvents.

Another way to effectively communicate between scripts is by exposing an API using a ModuleScript.

0
I need server -> NPC so that would be server to client, hence BindableEvents can't be used. Remote Event can only communicate from server to a Player client, but my client is not a player, it's an NPC so it can't be used. I've never tried using module scripts before, I might check that out. lesliesoon 86 — 6y
0
If your NPCs are run with LocalScripts, they're run by clients -- in particular, probably ALL clients, separately. If there are no LocalScripts involved, they are NOT clients. Just because it looks like a human doesn't make it a client. And to reiterate, ModuleScripts cannot cross the Server | Client boundary. BlueTaslem 18071 — 6y
Ad

Answer this question