Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

FireServer can only be called from the client ???

EDIT: Turns out the solution to my problem is to use BindableEvents for server-to-server communication. I was super confused as to why this wasn't already a feature in ROBLOX - glad someone pointed me in the right direction.

I want to create a RemoteEvent that fires whenever a ClickDetector is clicked. However, my current code (which I adopted from http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial ) only works in Play Solo mode.

Whenever I test the code in a test server, clicking the button results in the following error: FireServer can only be called from the client

None of the scripts I am using are Local scripts.

FilteringEnabled is NOT turned on - I am just using RemoteEvents for (what I thought was) the convenience.

Is this possible? Thanks in advanced.

2 comments

1

FireServer has to be used in a LocalScript.

1 answer

✓ Accepted answer

Well, what you are asking for is sadly, not possible. You can't call FireServer() function in a ServerScript and vice-versa.. So, I suggest just using LocalScripts I mean it doesn't exactly do anything bad for it. Just depends on how you use it. Also, in my opinion, RemoteEvents do keep your game a bit organized I believe so. Also, it runs your games smoothly and just in-case you decide to use FilteringEnabled in the future you don't have to worry about editing the code. So it's a great idea.

I hope I helped in some way, and thank you for reading this answer.

~~ KingLoneCat

2 comments

1

If you wish to fire an event from server to server or from a client to that same client, consider using BindableEvents instead.

0

BindableEvents are exactly what I am looking for - thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.