|
| 19 Jul 2015 06:23 PM |
local Players = game:GetService("Players") local player = game.Players.LocalPlayer
if game.Players.PlayerAdded then script.Parent.Text = players:GetFullName() .. " has entered the game!" end
I need it to not put out the Players. part
Ive literally stared at this for an hour.... help. |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2015 06:26 PM |
try this:
game.Players.PlayerAdded:connect(function(p) script.Parent.Text = p.Name.." has entered the game!" end) |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2015 06:28 PM |
| no.... it still has my "Test" on when I try joining the game on studio |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Jul 2015 06:29 PM |
I tried both script and localscript.
Still nothing. |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Jul 2015 06:45 PM |
| Are you sure the script isnt disabled... |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2015 06:48 PM |
Positive! Hahaha, I just need to gain sanity!
I got this far by myself and its not even done yeeet. I need to tween this darn thing. (At least I know how to do that) |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 19 Jul 2015 06:50 PM |
| It's in a GUI. The StarterGui replicates to the PlayerGui AFTER the player has joined, so that won't work. Just use a localscript and do game.Players.LocalPlayer:GetFullName() |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 19 Jul 2015 06:50 PM |
"script.Parent.Text" sounds like you are trying to display the text of a player's name to a gui, am i right?
use a RemoteEvent, a local script inside of your gui and the such, and a server script
-- server script
local event = game.ReplicatedStorage:WaitForChild("RemoteEvent")
game.Players.PlayerAdded:connect(function(plr) event:FireAllClients("New Player", plr.Name) end)
-- local script with your guis n sht
local event = game.ReplicatedStorage:WaitForChild("RemoteEvent") -- the path to your gui objects n sht here
event.OnClientEvent:connect(function(...) local tuple = {...} if tuple[1] == "New Player" then script.Parent.Text = tuple[2] end end)
try that? |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2015 06:50 PM |
OOH WAIT ITS SUPPOSED TO BE CHILDADDED CUS LOCAL SCRIPT!
|
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 19 Jul 2015 06:52 PM |
well yes you could use ChildAdded in the local script.. still wouldn't do that though
i'd use a remote event to fire to all of the clients the new player's name, and display that new player's name to the gui. |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2015 06:54 PM |
Ok. I see, could you link me or explain what the RemoteEvent does?
Very new to scripting and would like to know more.
I managed to get my server to recognize more than 1 person and that took about an hr too. I make it play funky moosic!
im losing my mind... |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 19 Jul 2015 06:55 PM |
| No don't use a remote event; there's no need for it. |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2015 06:57 PM |
| ok lord where do I put the local script? My brain is so dead right now sorry. |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2015 07:02 PM |
local event = game.ReplicatedStorage:WaitForChild("RemoteEvent") game.StarterGui.ScreenGui.Frame.Textbox event.OnClientEvent:connect(function(...) local tuple = {...} if tuple[1] == "New Player" then script.Parent.Text = tuple[2] end end)
event in event.OnClientEvent:connect
has a squiggle red line of death.
|
|
|
| Report Abuse |
|
|
|
| 19 Jul 2015 07:13 PM |
Oh well thanks for helping guys
Ill just sit in my corner |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 19 Jul 2015 07:45 PM |
| just put it in the StarterGui and the local script gets replicated to the PlayerGui, where it can run. |
|
|
| Report Abuse |
|
|
| |
|