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: FireClient

Previous Thread :: Next Thread 
Majorhappenings is not online. Majorhappenings
Joined: 25 Dec 2013
Total Posts: 299
27 Feb 2017 09:46 PM
I'm trying to get a better grasp on FireClient and how to pass arguments through that to change a players gui based on a server touched event. Every time I use ########lients: then it works but just FireClient doesn't work. Any idea?
Report Abuse
ArmaVictorem is not online. ArmaVictorem
Joined: 18 Mar 2015
Total Posts: 1332
27 Feb 2017 09:49 PM
the first argument of fireclient is the player then whatever you're trying to pass to the client

you need to define player first though

for example
yourevent:FireClient(player,var)
Report Abuse
Majorhappenings is not online. Majorhappenings
Joined: 25 Dec 2013
Total Posts: 299
27 Feb 2017 09:51 PM
I did do that.. Gives error in the OnClientEvent function saying player is nil


local ev = game.ReplicatedStorage:WaitForChild("GUIMessage")
script.Parent.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if(player) then
ev:FireClient(player)
end
end)
Report Abuse
Majorhappenings is not online. Majorhappenings
Joined: 25 Dec 2013
Total Posts: 299
27 Feb 2017 09:52 PM
local script..


local gui = script.Parent:WaitForChild("TextLabel")

local guiMessage = game.ReplicatedStorage:WaitForChild("GUIMessage")

guiMessage.OnClientEvent:connect(function(player)

gui.Text = player.Name
end)
Report Abuse
ArmaVictorem is not online. ArmaVictorem
Joined: 18 Mar 2015
Total Posts: 1332
27 Feb 2017 09:54 PM
print player then tell me what happens
Report Abuse
Majorhappenings is not online. Majorhappenings
Joined: 25 Dec 2013
Total Posts: 299
27 Feb 2017 09:55 PM
prints nil These events confuse me lol Because when I switch it to ########lients it works but obviously I just want it for the single client.
Report Abuse
ArmaVictorem is not online. ArmaVictorem
Joined: 18 Mar 2015
Total Posts: 1332
27 Feb 2017 09:57 PM
local player = game.Players:GetPlayerFromCharacter(hit.Parent) this is the problem then
are you using some sort of morph when touching the part?
Report Abuse
Majorhappenings is not online. Majorhappenings
Joined: 25 Dec 2013
Total Posts: 299
27 Feb 2017 09:58 PM
Nothing absolutely nothing

i'm just in a blank game with a part with a script in it.. and then a gui that is given to a player on enter.
Report Abuse
Majorhappenings is not online. Majorhappenings
Joined: 25 Dec 2013
Total Posts: 299
27 Feb 2017 09:59 PM
Was just figuring out how to pass information to a player's gui based on a touched event by him.
Report Abuse
Majorhappenings is not online. Majorhappenings
Joined: 25 Dec 2013
Total Posts: 299
27 Feb 2017 10:07 PM
anyone?
Report Abuse
Majorhappenings is not online. Majorhappenings
Joined: 25 Dec 2013
Total Posts: 299
27 Feb 2017 10:29 PM
Why can't you pass arguments to the client?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
27 Feb 2017 11:05 PM
### can with RemoteEvents/Functions
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
27 Feb 2017 11:55 PM
### can pass arguments to the client. In your localscript, your problem is that you're putting the player as an argument of OnClientEvent. You have to specify the player you're firing to in FireClient, but in OnClientEvent, the player isn't an argument because you're in a localscript so you already have the player. OnClientEvent has no arguments unless you specify them. http://wiki.roblox.com/index.php?title=API:Class/RemoteEvent/OnClientEvent Hence its arguments being 'variant'. Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow me on twitch: twitch.tv/austinrblx
Report Abuse
Wrathsong is online. Wrathsong
Joined: 05 Jul 2012
Total Posts: 22393
27 Feb 2017 11:55 PM
IT CENSORED 'YOU' WHAT


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow me on twitch: twitch.tv/austinrblx
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
28 Feb 2017 12:33 AM
Did in mine too, lol


Report Abuse
Majorhappenings is not online. Majorhappenings
Joined: 25 Dec 2013
Total Posts: 299
02 Mar 2017 12:10 PM
I realized the whole time I forgot to add the extra player in the arguments. (Slap face)

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