Intern33t
|
  |
| Joined: 19 Nov 2010 |
| Total Posts: 1530 |
|
|
| 23 May 2015 11:08 AM |
LocalScript:
buttonNormal.MouseButton1Up:connect(function() workspace.Selected:FireServer("normal", game.Players.LocalPlayer) end)
Server Script:
local event = Instance.new("RemoteEvent") event.Parent = workspace event.Name = "Selected" event.OnServerEvent:connect(function(type, player) print(type) end)
It prints "Player" though it should print "normal". Why?
~ᵂʰᵒ ᵃʳᵉ ʸᵒᵘ ᵗᵒᵈᵃʸ﹖~ |
|
|
| Report Abuse |
|
|
Intern33t
|
  |
| Joined: 19 Nov 2010 |
| Total Posts: 1530 |
|
|
| 23 May 2015 11:14 AM |
watch out! random bump incoming
because im going to the trampoline
*badum tss*
~ᵂʰᵒ ᵃʳᵉ ʸᵒᵘ ᵗᵒᵈᵃʸ﹖~ |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 11:15 AM |
The 1st argument is always the player. event.OnServerEvent:connect(function(player, type) print(type) Should work.
Also, use a :WaitForChild() for the RemoteEvent.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 23 May 2015 11:15 AM |
OnServerEvent already returns the player
OnServerEvent(playerWhoFiredServer, ...) |
|
|
| Report Abuse |
|
|
Intern33t
|
  |
| Joined: 19 Nov 2010 |
| Total Posts: 1530 |
|
|
| 23 May 2015 11:19 AM |
local: workspace.Event:FireServer(game.Players.LocalPlayer, "normal")
server: event.OnServerEvent:connect(function(player, type) print("Got it") print(type) >Got it >Player
._.
~ᵂʰᵒ ᵃʳᵉ ʸᵒᵘ ᵗᵒᵈᵃʸ﹖~ |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 23 May 2015 11:20 AM |
| workspace.Event:FireServer("normal") |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 11:20 AM |
Stop being a noob. :P Jk.
local: workspace.Event:FireServer("normal")
server: event.OnServerEvent:connect(function(player, type) print("Got it") print(type)
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
Intern33t
|
  |
| Joined: 19 Nov 2010 |
| Total Posts: 1530 |
|
|
| 23 May 2015 11:21 AM |
Alright, i got it now:
workspace.Selected:FireServer("normal") event.OnServerEvent:connect(function(player, type) print(type) >normal
~ᵂʰᵒ ᵃʳᵉ ʸᵒᵘ ᵗᵒᵈᵃʸ﹖~ |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 11:22 AM |
Just saying, why would :FireServer() need to send the player? It automatically gets it from the client.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 11:37 AM |
| http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial |
|
|
| Report Abuse |
|
|
|
| 23 May 2015 11:39 AM |
@Epic
Was that to me?
I was just asking him why he put LocalPlayer in there. :P
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 May 2015 11:45 AM |
Ah, kk.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784
|
|
|
| Report Abuse |
|
|