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: RemoteEvent not getting correct arguments

Previous Thread :: Next Thread 
Intern33t is not online. 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 is not online. 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
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
23 May 2015 11:15 AM
OnServerEvent already returns the player

OnServerEvent(playerWhoFiredServer, ...)
Report Abuse
Intern33t is not online. 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 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
23 May 2015 11:20 AM
workspace.Event:FireServer("normal")
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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 is not online. 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
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
23 May 2015 11:37 AM
http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
23 May 2015 11:44 AM
No, it was for Intern33t.
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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
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