Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I have a directory in directory?

Hi for some reason I can't find anything about this but how would I do this?

game.Players.Player.Name

Player.Name would be the directory inside the directory. Also, I have the

local Player = game.Players.LocalPlayer

As the variable.

2 comments

0

What exactly are you trying to do? What is the goal of your code?

0

I think he trying to randomly get a player out of Players, and affect them.

3 answers

if you do Player.Name it looks for it's property called Name, use FindFirstChild, it will look for children of the directory only:

game.Players.Player:FindFirstChild('Name')

Or am i missing something?

Well, how I am doing it I have a list of all the players as a bool value. And I want to filter it out with just the one player who is affected.

local Players = game.Players:GetPlayers()
local nplrs = #Players
local Randomplayer = nil
if nplrs > 0 then
     Randomplayer = Players[math.random(1, nplrs)]
	--Do your function here
end

3 comments

0

Hope This Helped :D

0

Not really but I was able to make it work.

0

oh ok

This discussion is preserved as it was. New answers, comments, and votes are closed.