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: I really want this fixed

Previous Thread :: Next Thread 
tootoo123456 is not online. tootoo123456
Joined: 23 Apr 2010
Total Posts: 310
02 Jan 2016 04:38 PM
I need to know what my problem is so I can progress in lua scripting. Heres the code with no errors in the output.

if game.Players.NumPlayers~=0 then
print("More than 0")
game.Players.PlayerAdded:connect(function(player)
local gui=Instance.new("ScreenGui", game:WaitForChild("StarterGui"))
local label=Instance.new("TextLabel", gui)
label.Position=UDim2.new(0,450,0,-50)
label.Size=UDim2.new(0,400,0,50)
label:TweenPosition(UDim2.new(0,450,0,0), "Out", "Bounce", 2)
label.BackgroundColor3=Color3.new(200,255,0)
label.TextScaled=true
label.TextColor3=Color3.new(0,0,0)
label.Text=player.Name.."has joined!"
wait(3)
label:Destroy()

end)
end
Report Abuse
tootoo123456 is not online. tootoo123456
Joined: 23 Apr 2010
Total Posts: 310
02 Jan 2016 05:11 PM
b
Report Abuse
MahouReikon is not online. MahouReikon
Joined: 15 Feb 2014
Total Posts: 1359
02 Jan 2016 05:12 PM
local gui=Instance.new("ScreenGui", game:WaitForChild("StarterGui"))


The Legend of Heroes Sen no Kiseki
Report Abuse
Netakra is not online. Netakra
Joined: 02 Dec 2015
Total Posts: 606
02 Jan 2016 05:13 PM
The issue is that this is in a regular script in workspace I believe, so it checks if the number of players is more than 0 right when the server is loading up, so before the player even enters the game. That way, it will not run the game.Players.PlayerAdded() event.

Try doing the playerAdded function first and deleting the number of players check, it's not needed.
Report Abuse
Netakra is not online. Netakra
Joined: 02 Dec 2015
Total Posts: 606
02 Jan 2016 05:15 PM
Are you just trying to make it display a gui saying that a player has joined?

Just make the gui and once it's all set up, insert it w/ a for loop into all the player's PlayerGuis and then remove it after 3 seconds via for loop again.


|Netakra|
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