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 Help

Previous Thread :: Next Thread 
DunclubDuncan is not online. DunclubDuncan
Joined: 05 Nov 2015
Total Posts: 984
30 Dec 2016 11:27 AM
Inside a Script within ServerScriptService

game.Players.PlayerAdded:connect(function(Player)
if string.sub(Player.Name,1,6)=="Guest " then
Player:Kick("You must be logged into ROBLOX.com to play this game.")
end
game.ReplicatedStorage.PlayerJoin:FireClient(Player)
end)



Inside a LocalScript within StarterGui

local StarterGui = game:GetService('StarterGui')

game.ReplicatedStorage.PlayerJoin.OnClientEvent:connect(function(Player)
StarterGui:SetCore("ChatMakeSystemMessage", {
Text = Player.." has joined the server.";
Color = Vector3.new(1, 1, 0);
Font = Enum.Font.SourceSansBold;
FontSize = Enum.FontSize.Size18;
})
end)



The Error

11:24:21.372 - Players.Player1.PlayerGui.LocalScript:4: attempt to concatenate local 'Player' (a nil value)
11:24:21.373 - Stack Begin
11:24:21.373 - Script 'Players.Player1.PlayerGui.LocalScript', Line 4
11:24:21.374 - Stack End
11:24:21.471 - Unable to load plugin icon.


Report Abuse
foreverpower is not online. foreverpower
Joined: 05 Feb 2011
Total Posts: 5578
30 Dec 2016 11:28 AM
It's against the roblox rules to ban guests.


Report Abuse
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
30 Dec 2016 11:29 AM
Player is an object, you cant manipulate it with strings

Your looking for Player.Name
Report Abuse
DunclubDuncan is not online. DunclubDuncan
Joined: 05 Nov 2015
Total Posts: 984
30 Dec 2016 11:31 AM
Sorry, I didn't know that. The game I'm banning them from is an all-chat game with no actual gameplay. Because Guests cannot chat, and they're not allowed to, they serve no purpose in the game and get kicked.


Report Abuse
DunclubDuncan is not online. DunclubDuncan
Joined: 05 Nov 2015
Total Posts: 984
30 Dec 2016 11:32 AM
And I tried "Text = Player.Name.." has joined the server.";" before, the same error occurred.


Report Abuse
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
30 Dec 2016 11:32 AM
Also when using FireClient, First variable is the person that it goes to, it cannot be used in the event. So do:

FireClient(Player,Player)

When picking up on the server with OnClientEvent

use (...)
and then
local tuple = {...}
to get all the arguments passed
Report Abuse
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
30 Dec 2016 11:34 AM
game.ReplicatedStorage.PlayerJoin.OnClientEvent:connect(function(...)
local tuple = {...}
StarterGui:SetCore("ChatMakeSystemMessage", {
Text = tuple[1].Name.." has joined the server.";
Color = Vector3.new(1, 1, 0);
Font = Enum.Font.SourceSansBold;
FontSize = Enum.FontSize.Size18;
})
end)
Report Abuse
DunclubDuncan is not online. DunclubDuncan
Joined: 05 Nov 2015
Total Posts: 984
30 Dec 2016 11:36 AM
Thank you, that seems to have worked.


Report Abuse
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
30 Dec 2016 11:37 AM
Np
Report Abuse
DunclubDuncan is not online. DunclubDuncan
Joined: 05 Nov 2015
Total Posts: 984
30 Dec 2016 11:37 AM
Here's the game I'm using this for if you are interested.
https://www.roblox.com/games/593157988/Chat-The-Game#!/about


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