Pejorem
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 637 |
|
|
| 02 Jan 2017 11:55 AM |
Would one way to do it maybe:
--SERVER event.OnServerEvent:connect(function(plr, option) if option == "event one" then --do stuff end end) event.OnServerEvent:connect(function(plr, option) if option == "event two" then --do stuff end end)
--CLIENT local plr = game.Players.LocalPlayer clickDetector.MouseClick:connect(function(hit) game.Workspace.MyServerEvent:FireServer(plr, "event one") end)
clickDetector2.MouseClick:connect(function(hit) game.Workspace.MyServerEvent:FireServer(plr, "event two") end)
Is there a better way?
Google "Scripting Helpers" to find a "better" forum - http://wiki.roblox.com/index.php?title=AllTutorials - http://wiki.roblox.com/index.php?title=API:Class_reference - Google "Programming in Lua" for The book |
|
|
| Report Abuse |
|
|
|
| 02 Jan 2017 12:03 PM |
phantom forces did it
you can prob find the code somewhere
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
Pejorem
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 637 |
|
|
| 02 Jan 2017 12:04 PM |
ahmk, ty.
Google "Scripting Helpers" to find a "better" forum - http://wiki.roblox.com/index.php?title=AllTutorials - http://wiki.roblox.com/index.php?title=API:Class_reference - Google "Programming in Lua" for The book |
|
|
| Report Abuse |
|
|
GearMechs
|
  |
| Joined: 01 Dec 2010 |
| Total Posts: 1220 |
|
|
| 02 Jan 2017 12:05 PM |
You could insert multiple module scripts under the server script, and have the RE call whichever module you specify.
Project Leader for OKS - GearMechs |
|
|
| Report Abuse |
|
|
Pejorem
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 637 |
|
|
| 02 Jan 2017 12:07 PM |
So basically just using arguments to specify what I want processing?
Google "Scripting Helpers" to find a "better" forum - http://wiki.roblox.com/index.php?title=AllTutorials - http://wiki.roblox.com/index.php?title=API:Class_reference - Google "Programming in Lua" for The book |
|
|
| Report Abuse |
|
|
Crimsonal
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1795 |
|
|
| 02 Jan 2017 12:07 PM |
--SERVER event.OnServerEvent:connect(function(plr, option) if option == "event one" then --do stuff elseif option == "event two" then -- do stuff end end)
|
|
|
| Report Abuse |
|
|
Pejorem
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 637 |
|
|
| 02 Jan 2017 12:09 PM |
So basically using an argument to specify what is to be processed?
Google "Scripting Helpers" to find a "better" forum - http://wiki.roblox.com/index.php?title=AllTutorials - http://wiki.roblox.com/index.php?title=API:Class_reference - Google "Programming in Lua" for The book |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 02 Jan 2017 12:25 PM |
thats how your suppose to do it anyways because you need to verify the values
re.OnServerEvent:connect(function(player,reason,...) if reason == 'blah' then elseif reason == 'blah2' then end end)
|
|
|
| Report Abuse |
|
|
Pejorem
|
  |
| Joined: 10 Apr 2012 |
| Total Posts: 637 |
|
|
| 02 Jan 2017 12:27 PM |
o crap. Ye. Erm. I totally knew that 0.0 Just saved my soul and my skins, ty. If only my thought capacity went beyond level potato.
Google "Scripting Helpers" to find a "better" forum - http://wiki.roblox.com/index.php?title=AllTutorials - http://wiki.roblox.com/index.php?title=API:Class_reference - Google "Programming in Lua" for The book |
|
|
| Report Abuse |
|
|