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

Is there a way to access the players from a localscript?

I have this part of a script

for _,v in pairs(game.Players:GetChildren()) do
	fram:Clone().Parent = v:WaitForChild("PlayerGui").chat.back
	updateOldMsg(v:WaitForChild("PlayerGui").chat.back)
end

but it doesn't work, the entire script but that part works fine

3 answers

Well on line 2, you said "fram:Clone()" if that's just the name, ok, but it looks like you misspelled "frame". Maybe that's the problem instead of the players?

1 comment

0

no, that's just the name

I think you did your looping wrong.

Try

players = game.Players:GetChildren()

for i,v in pairs(players) do
    fram:Clone().Parent = v:WaitForChild("PlayerGui").chat.back
    updateOldMsg(v:WaitForChild("PlayerGui").chat.back)
end

1 comment

0

Nah, using i,v is the same as _,v. Also, by making a variable for players:GetChildren() doesn't do anything.

All players or just one? If just one, use LocalPlayer.

1 comment

0

all, im clearly using a for loop to search through the players

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