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
 

Why does my Remote Event not work on Server mode?

Previous Thread :: Next Thread 
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 07:18 AM
It works in play mode, but not server mode. I tested the script, the script fires the event properly, but the receive just somehow doesn't receive it in server mode. Here is the code of the function.

local SpawnEvent = game.ReplicatedStorage:WaitForChild("SpawnHyperloop")
function spawnHyperloop(name)

end
SpawnEvent.OnServerEvent:connect(spawnHyperloop)
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 07:19 AM
This is a script in the workspace btw
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 07:35 AM
bump
Report Abuse
Kiriot22 is not online. Kiriot22
Joined: 19 Jul 2015
Total Posts: 226
04 Nov 2017 07:51 AM
And what is the localscript?
Report Abuse
mattscy is online. mattscy
Joined: 06 May 2011
Total Posts: 1079
04 Nov 2017 07:53 AM
are you creating the remote event with the local script?

if you are and fe is on then your server wont see the event after its created

just use an already existing one, or create the remote event with the server script


Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 08:07 AM
@mattscy - The remote event is stored in Replicated storage
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 08:09 AM
@Kiriot - Here is what was in the local script. The local script is part of player gui.


local SpawnHyperloop = game.ReplicatedStorage:WaitForChild("SpawnHyperloop")

function click()
SpawnHyperloop:FireServer()
end
script.Parent.MouseButton1Click:connect(click)
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 08:24 AM
bump2
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 08:28 AM
bump3
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 08:32 AM
bump4
Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
04 Nov 2017 08:35 AM
Try using prints in various spots in both scripts
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 08:38 AM
^ Yes I did and I figured out that the event fires properly, but the listener doesn't listen. That is why I included the listener's script at the top
Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
04 Nov 2017 08:39 AM
Are you sending a name argument?
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 08:42 AM
^ What do you mean by name argument?
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 08:43 AM
Btw I don't think the problem is the code itself, I placed the listener in the WorkSpace and I think that is the reason it doesn't work. However, how do I make a listener work in Workspace?
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 08:50 AM
bump5
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 08:52 AM
Bump6
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 09:11 AM
bump7
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 11:14 AM
Cmon guys this shouldn't be a hard problem to fix.....
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 11:16 AM
It works in normal play-mode just not server mode. That means the code is probably correct
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 11:21 AM
Here is the whole code in one piece. The 1st piece is an ordinary script placed in ServerScriptService. The function doesn't run... The 2nd piece of code is a Local Script that fires the remote event. It works

game.ReplicatedStorage:WaitForChild("SpawnHyperloop1").OnServerEvent:connect(function(player)
print("EVENT LISTENED")
local a = game.ServerStorage.ET31:Clone()
print("CLONED")
a.Parent=game.Workspace
end)


local SpawnHyperloop = game.ReplicatedStorage:WaitForChild("SpawnHyperloop1")
function click()
SpawnHyperloop:FireServer()
print("FIRED")
end
script.Parent.MouseButton1Click:connect(click)
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 11:26 AM
bump again!
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 11:27 AM
Seriously guys? No one know what the problem is?!
Report Abuse
Kevinllululala is not online. Kevinllululala
Joined: 03 Mar 2013
Total Posts: 823
04 Nov 2017 11:33 AM
I thought there are supposed to be lots of knowledgeable people in the Scripter forum. And no can find the problem to a freaking 20 line remote event code?!
Report Abuse
7263 is not online. 7263
Joined: 11 Jan 2011
Total Posts: 87
04 Nov 2017 11:33 AM
Well, the problem does not seem very clear, however, you are passing the Player object to the function "spawnHyperloop(name)" as "name" since the return for "OnServerEvent" is "Player, Arguments".

Other than that I do not see what the problem could be, maybe you are getting errors in output that might help?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 2Go to page: [1], 2 Next
 
 
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