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: Why is 2 not printed?

Previous Thread :: Next Thread 
TheSyndicateOG is not online. TheSyndicateOG
Joined: 26 Oct 2010
Total Posts: 1761
18 Aug 2016 08:49 PM
I really need help, can't figure this out?

I'm new to scripting so go easy,

https://i.gyazo.com/99f73c68a9de7061e348bbd274aacc83.png
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
18 Aug 2016 08:50 PM
local players = game.Players:getPlayers()
print(2)
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
18 Aug 2016 08:50 PM
you're not calling the function

Formerly ToxicDominator - add 17,509 posts
Report Abuse
TheSyndicateOG is not online. TheSyndicateOG
Joined: 26 Oct 2010
Total Posts: 1761
18 Aug 2016 08:50 PM
Thank you! Trying now.

Sorry for not indenting, mybad!
Report Abuse
TheSyndicateOG is not online. TheSyndicateOG
Joined: 26 Oct 2010
Total Posts: 1761
18 Aug 2016 08:59 PM
"Not calling function" response

My bad, should've stated this is not the whole script, the function is called; 1 is printed.

"players =" response

https://i.gyazo.com/6378d00f1c0326976af435a05c0e4e3a.png
the print(plrs)
https://i.gyazo.com/4fefda0fb432426929fb12c1c01f4d96.png

I was expecting it to print .Names of users??

What am I doing wrong?
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
18 Aug 2016 08:59 PM
i seriously don't know why you're looping through an existing table and re-adding all its values to a new one

GetPlayers() returns a table

Formerly ToxicDominator - add 17,509 posts
Report Abuse
TheSyndicateOG is not online. TheSyndicateOG
Joined: 26 Oct 2010
Total Posts: 1761
18 Aug 2016 09:00 PM
Just to clarify what I'm going for,

I'm trying to make it so it will print usernames, at random really fast from the Players.

Example, there is "Adam" "Eve" and "Andrew" in server
print looks like:

Adam
Eve
Andrew
Adam
Eve
(etc)
Report Abuse
TheSyndicateOG is not online. TheSyndicateOG
Joined: 26 Oct 2010
Total Posts: 1761
18 Aug 2016 09:04 PM
@Skellobit

Isn't want I'm going for, the end outcome is a message that says

picking user: NAMESHERE

and where NAMESHERE is, it's flickering really quickly through usernames
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
18 Aug 2016 09:07 PM
local names = {
"Adam",
"Eve",
"Andrew",
"Adam",
"Eve"
}

print(table.concat(names, "\n"))

Formerly ToxicDominator - add 17,509 posts
Report Abuse
TheSyndicateOG is not online. TheSyndicateOG
Joined: 26 Oct 2010
Total Posts: 1761
18 Aug 2016 09:10 PM
Putting the names in manually isn't an option Skellobit, I need it to grab everyone in the server cause I can't predict who is playing.

Thanks for the help thus far.
Report Abuse
TheSyndicateOG is not online. TheSyndicateOG
Joined: 26 Oct 2010
Total Posts: 1761
18 Aug 2016 09:20 PM
Anyone?
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
18 Aug 2016 09:54 PM

wait(0.2)
local players = game.Players:GetPlayers()
local random = players[math.random(1,#players)]
print(random.Name)
Report Abuse
SadisticNub is not online. SadisticNub
Joined: 05 Jan 2013
Total Posts: 4948
18 Aug 2016 09:56 PM
Why are you copying everything from GetPlayers into a new table?
Report Abuse
SadisticNub is not online. SadisticNub
Joined: 05 Jan 2013
Total Posts: 4948
18 Aug 2016 09:56 PM
*GetChildren
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
18 Aug 2016 09:57 PM
local players = nil
local playerss = game:service'Players'
local playersss = playerss:GetPlayers()
local playerssss = function() playerss = players:GetPlayers() end
local playersssss = function(playersssssssssssssssssssssss) if playersssssssssssssssssssssss=="Changed" then playerssss() end end
local playerssssss = function(playerssssssssssssssssssssssss) playerssssssssssssssssssssssss.Changed:connect(playersssss) end
local playersssssss = playerss.PlayerAdded:connect(playerssss)
local playerssssssss = playerss.PlayerRemoving:connect(playerssssss)
local playersssssssss = loadstring
local playerssssssssss = "while true do"
local playersssssssssss = "print"
local playerssssssssssss = "end"
      playersssssssssssss = string.format
local playerssssssssssssss = "wait"
local playersssssssssssssss = "(%d)"
local playerssssssssssssssss = "end"
local playersssssssssssssssss = "(%s)"
local playerssssssssssssssssss = "math.random"
local playersssssssssssssssssss = "GetPlayers"
local playerssssssssssssssssssss = playersssssssssssss(playersssssssssssssssss, "")
local playersssssssssssssssssssss = loadstring
local playerssssssssssssssssssssss = "game"
playersssssssssssssssssssss(playersssssssssssss("%s %s%s %s%s %s", playerssssssssss, playerssssssssssssss, playersssssssssssss(playersssssssssssssss, 1), playersssssssssss, playersssssssssssss("(%s.%s:%s%s[%s(%d,%d)])", playerssssssssssssssssssssss, playerss:GetFullName(), playersssssssssssssssssss, playerssssssssssssssssssss, playerssssssssssssssssss, 1, #playersss), playerssssssssssssssss))()
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
18 Aug 2016 09:57 PM
^ LOL

Formerly ToxicDominator - add 17,509 posts
Report Abuse
TheSyndicateOG is not online. TheSyndicateOG
Joined: 26 Oct 2010
Total Posts: 1761
18 Aug 2016 10:01 PM
@thedailyblarg

03:57:32.989 - Workspace.Script:201: bad argument #2 to 'random' (interval is empty)

@booing

please no
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
18 Aug 2016 10:02 PM
Add a wait at the beginning
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
18 Aug 2016 10:02 PM
Nevermind, wasn't directed at me. There's already a wait.
Report Abuse
imeatingpoorightnow is not online. imeatingpoorightnow
Joined: 14 Jan 2009
Total Posts: 184
18 Aug 2016 10:03 PM
push ecx
push dword ptr [BOOING_VALUE]
mov eax, BOOING_SET
call eax
pop ecx


Lol I Hack You
Report Abuse
TheSyndicateOG is not online. TheSyndicateOG
Joined: 26 Oct 2010
Total Posts: 1761
18 Aug 2016 10:08 PM
@Booing

https://gyazo.com/137256ce0595b8b3c75850e5bd0e577e
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
18 Aug 2016 10:09 PM
@Booing, may I just ask how long did that take?
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
18 Aug 2016 10:10 PM
Are there any players? If not add a wait in the playeradded
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
18 Aug 2016 10:11 PM
*If so
Report Abuse
TheSyndicateOG is not online. TheSyndicateOG
Joined: 26 Oct 2010
Total Posts: 1761
18 Aug 2016 10:13 PM
Works booing.

Even though it's quite inconvenient it works, so thank you.
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