|
| 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 |
|
|
|
| 18 Aug 2016 08:50 PM |
local players = game.Players:getPlayers() print(2) |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 18 Aug 2016 08:50 PM |
Thank you! Trying now.
Sorry for not indenting, mybad! |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 18 Aug 2016 09:56 PM |
| Why are you copying everything from GetPlayers into a new table? |
|
|
| Report Abuse |
|
|
| |
|
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
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 18 Aug 2016 09:57 PM |
^ LOL
Formerly ToxicDominator - add 17,509 posts |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 04 May 2009 |
| Total Posts: 6594 |
|
|
| 18 Aug 2016 10:02 PM |
| Add a wait at the beginning |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 18 Aug 2016 10:08 PM |
@Booing
https://gyazo.com/137256ce0595b8b3c75850e5bd0e577e |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2016 10:09 PM |
| @Booing, may I just ask how long did that take? |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 04 May 2009 |
| Total Posts: 6594 |
|
| |
|
|
| 18 Aug 2016 10:13 PM |
Works booing.
Even though it's quite inconvenient it works, so thank you. |
|
|
| Report Abuse |
|
|