generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Remote Events [HELP]

Previous Thread :: Next Thread 
AndreiBernikov is online. AndreiBernikov
Joined: 24 Aug 2014
Total Posts: 130
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
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
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 is not online. 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 is not online. 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
AndreiBernikov is online. AndreiBernikov
Joined: 24 Aug 2014
Total Posts: 130
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
AndreiBernikov is online. AndreiBernikov
Joined: 24 Aug 2014
Total Posts: 130
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 is not online. Afro_Sub
Joined: 16 Jun 2013
Total Posts: 1114
10 Sep 2016 04:26 PM
What are your scripts

Exact scripts.



Report Abuse
AndreiBernikov is online. AndreiBernikov
Joined: 24 Aug 2014
Total Posts: 130
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
CaptainGector is not online. CaptainGector
Joined: 02 May 2014
Total Posts: 487
10 Sep 2016 04:31 PM
That needs to be OnClientEven if that's the local script.
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
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
CaptainGector is not online. CaptainGector
Joined: 02 May 2014
Total Posts: 487
10 Sep 2016 04:32 PM
Ignore what I said, I read the script wrong...
Report Abuse
Afro_Sub is not online. 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
AndreiBernikov is online. AndreiBernikov
Joined: 24 Aug 2014
Total Posts: 130
10 Sep 2016 04:33 PM
what do you mean OnClientEven?
Report Abuse
Afro_Sub is not online. 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 is not online. 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
AndreiBernikov is online. AndreiBernikov
Joined: 24 Aug 2014
Total Posts: 130
10 Sep 2016 04:34 PM
afro what do you want me to do?
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
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 is not online. 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
AndreiBernikov is online. AndreiBernikov
Joined: 24 Aug 2014
Total Posts: 130
10 Sep 2016 04:40 PM
ok trying
Report Abuse
AndreiBernikov is online. AndreiBernikov
Joined: 24 Aug 2014
Total Posts: 130
10 Sep 2016 04:47 PM
Workspace.Events.Script:3: invalid value (userdata) at index 1 in table for 'concat'
Report Abuse
TimeTicks is not online. 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
AndreiBernikov is online. AndreiBernikov
Joined: 24 Aug 2014
Total Posts: 130
10 Sep 2016 05:10 PM
FireServer can only be called from the client
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
10 Sep 2016 05:37 PM
#############################################################################################
Report Abuse
AndreiBernikov is online. AndreiBernikov
Joined: 24 Aug 2014
Total Posts: 130
11 Sep 2016 03:21 AM
hashhhhhhhhhhhh tagssssssssss
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image