Fatalizer
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 1520 |
|
|
| 05 Jan 2015 07:26 AM |
Hello,
I'm making my game and I have a little Screengui that says
p.Name .. " Has connected" , it's small and white it will go away in 3 seconds. But when 2 people join at the same time, it will mess up and get the 2 texts like it's 1 text, how can I fix this ? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 05 Jan 2015 07:29 AM |
| Depends how you're handling it, dude. |
|
|
| Report Abuse |
|
|
Fatalizer
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 1520 |
|
|
| 05 Jan 2015 07:32 AM |
This is my script, real simple;
game.Players.PlayerAdded:connect(function(p) script.Parent.Text = p.Name .. " Has Connected!" wait"3" script.Parent.Text = " " end) |
|
|
| Report Abuse |
|
|
Fatalizer
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 1520 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 05 Jan 2015 07:41 AM |
script.Parent.Text = (script.Parent.Text == "" and p.Name.." has connected. " or script.Parent.Text..p.Name.." has connected.")
Idk I'm not really sure what you're expecting to happen here dude |
|
|
| Report Abuse |
|
|
Fatalizer
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 1520 |
|
|
| 05 Jan 2015 07:43 AM |
That it will change the text into
"Fatalizer Has Connected" as soon as I join the game, or somebody else depends on the name. |
|
|
| Report Abuse |
|
|
|
| 05 Jan 2015 07:43 AM |
| "wait" takes a number, not a string. |
|
|
| Report Abuse |
|
|
Fatalizer
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 1520 |
|
|
| 05 Jan 2015 07:44 AM |
You can do both. You can use wait() wait"" wait'' |
|
|
| Report Abuse |
|
|
|
| 05 Jan 2015 07:45 AM |
| That's only because you are implicitly converting it to a number. It still doesn't take a string. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 05 Jan 2015 07:46 AM |
| (I just assumed that Roblox typecasted it incase of people being bubs) |
|
|
| Report Abuse |
|
|
Fatalizer
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 1520 |
|
|
| 05 Jan 2015 07:46 AM |
| Could be, bit it's kinda off-topic. |
|
|
| Report Abuse |
|
|
| |
|
Fatalizer
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 1520 |
|
|
| 05 Jan 2015 07:47 AM |
| It isn't such lol, though. |
|
|
| Report Abuse |
|
|
Fatalizer
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 1520 |
|
| |
|
Fatalizer
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 1520 |
|
| |
|
|
| 05 Jan 2015 08:09 AM |
add a line before it changes to player .. "has connected" that changes the text to nothing ""
ps im on my phone |
|
|
| Report Abuse |
|
|
Fatalizer
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 1520 |
|
| |
|
|
| 05 Jan 2015 08:16 AM |
| add an if statmeny to check if the text is already filled if so, make another textlabel 100 pixels above with player .. "has connected" |
|
|
| Report Abuse |
|
|
Fatalizer
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 1520 |
|
|
| 05 Jan 2015 08:22 AM |
| That´s the problem, I can´t do things like that yet. |
|
|
| Report Abuse |
|
|
| |
|
Fatalizer
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 1520 |
|
|
| 05 Jan 2015 08:27 AM |
| Check if it's already filled and else make a new text 100 pixels above. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 05 Jan 2015 08:31 AM |
Put this in a script, the script inside of your ScreenGui and then your thing inside of the script
local o = script:GetChildren()[1] game.Players.PlayerAdded:connect(function(p) local n = o:Clone(); n.Parent = script.Parent; n.Position = n.Position+UDim2.new(0,0,0,n.Size.Y.Offset*(#script.Parent:GetChildren() - 2)) n.Text = p.Name.." has connected." wait(3) n:Destroy() end) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
Fatalizer
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 1520 |
|
|
| 05 Jan 2015 08:35 AM |
So it would be;
->StarterGui ->Screengui ->TextLabel --My script --eLunate Solition
Correct ? |
|
|
| Report Abuse |
|
|