|
| 10 Sep 2016 04:19 PM |
When I use NAME.OnServerEvent:connect(function() bla bla bla end)
it works in studio but when I get into the game, it says OnserverEvent can onlybe used on the server.. help? |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 04:22 PM |
because only the server scripts can connect to OnServerEvent FireServer should be on the client |
|
|
| Report Abuse |
|
|
Afro_Sub
|
  |
| Joined: 16 Jun 2013 |
| Total Posts: 1114 |
|
|
| 10 Sep 2016 04:22 PM |
That needs to be on a server script.
|
|
|
| Report Abuse |
|
|
Afro_Sub
|
  |
| Joined: 16 Jun 2013 |
| Total Posts: 1114 |
|
|
| 10 Sep 2016 04:23 PM |
The reason that this works solo test is because in solo test the server and the client run on your computer, so it is sending the packets to itself.
|
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 04:24 PM |
| it is on a server script, also my FE is turned off. Does it have something to do with that? |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 04:24 PM |
The event sender is in a local script, The one that gets it is in a server script.. |
|
|
| Report Abuse |
|
|
Afro_Sub
|
  |
| Joined: 16 Jun 2013 |
| Total Posts: 1114 |
|
|
| 10 Sep 2016 04:26 PM |
What are your scripts
Exact scripts.
|
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 04:29 PM |
Okay Local script :
pressed = false
local replicatedstorage = game:GetService("ReplicatedStorage") local MapEvent = replicatedstorage.Events.ManroMapEvent
script.Parent.MouseButton1Click:connect(function() if pressed == false then print("stmanro clicked") replicatedstorage.Events.ManroMapEvent:FireServer("Manro") script.Parent.Open:Play() wait() pressed = true end end)
Event is in Replicated storage.
server script :
ManroMapEvent.OnServerEvent:connect(function() bla bla bla end)
:/
|
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 04:31 PM |
| That needs to be OnClientEven if that's the local script. |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 04:31 PM |
replicatedstorage.Events.ManroMapEvent:FireServer("Manro")
and use a regular script to do
script.Parent.OnServerEvent:connect(function(...) print("received: " .. table.concat({...},", ")) end) |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 04:32 PM |
| Ignore what I said, I read the script wrong... |
|
|
| Report Abuse |
|
|
Afro_Sub
|
  |
| Joined: 16 Jun 2013 |
| Total Posts: 1114 |
|
|
| 10 Sep 2016 04:33 PM |
I did tell you to do that earlier lol op
|
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 04:33 PM |
| what do you mean OnClientEven? |
|
|
| Report Abuse |
|
|
Afro_Sub
|
  |
| Joined: 16 Jun 2013 |
| Total Posts: 1114 |
|
|
| 10 Sep 2016 04:33 PM |
Wait OP sorry I'm talking about the wrong thread
|
|
|
| Report Abuse |
|
|
Afro_Sub
|
  |
| Joined: 16 Jun 2013 |
| Total Posts: 1114 |
|
|
| 10 Sep 2016 04:34 PM |
He just said he misread it lol
I'm bumping your thread like hell
|
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 04:34 PM |
| afro what do you want me to do? |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 04:35 PM |
replicatedstorage.Events.ManroMapEvent:FireServer("Manro")
and use a regular script to do
script.Parent.OnServerEvent:connect(function(...) print("received: " .. table.concat({...},", ")) end)
script inside of the event
:| |
|
|
| Report Abuse |
|
|
Afro_Sub
|
  |
| Joined: 16 Jun 2013 |
| Total Posts: 1114 |
|
|
| 10 Sep 2016 04:37 PM |
We want you, OP, to print out what that guy said to print.
|
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Sep 2016 04:47 PM |
| Workspace.Events.Script:3: invalid value (userdata) at index 1 in table for 'concat' |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 10 Sep 2016 04:57 PM |
https://forum.roblox.com/Forum/ShowPost.aspx?PostID=193565057
|
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 05:10 PM |
| FireServer can only be called from the client |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2016 05:37 PM |
| ############################################################################################# |
|
|
| Report Abuse |
|
|
|
| 11 Sep 2016 03:21 AM |
| hashhhhhhhhhhhh tagssssssssss |
|
|
| Report Abuse |
|
|