Where does this folder go to?

I was confused on where exactly this “player” is that is taken down when a new player joins. Where does the “player” go and how exactly do I make it go into the player’s username in the Players default folder? Is that the best place to put it?

game.Players.PlayerAdded:Connect(function(player)
	local folder = Instance.new("Folder")
	folder.Name = "BoolValues"
	folder.Parent=player
	local value = Instance.new("BoolValue")
	value.Name = "ChillBool"
	value.Parent = folder
	value.Value=false
end)

It’s best to put it in ServerScriptService since this is a script that handles the PlayerAdded event.

This function fires when a new player joins, so each player will have a folder of BoolValues in them. You already have a player parameter, so the parameter defines the player who had joined.

Also, what do you mean by making it go into the player’s username in the Players default folder?

I think he means where the folder would go into the player. Yes, the script would go in ServerScript, but the folder would go into the players backpack when they join.

1 Like

I didn’t understand what you trying to say?

1 Like

how do I change the path that the “player” already takes? would that be player.Parent=(path)?

Also here’s an image of the players folder with me inside.
image

1 Like

What do you mean by “player.Parent”

The folder would already be parented to the player.

1 Like

There’s nothing in StarterPack when I play the game

1 Like

^ Might’ve quoted me by accident.

You know, you could just put the folder in the player by just doing folder.Parent = player so then it would just put the folder in the player, basically like the one in your picture.

It doesn’t go into starter pack. it goes under the default backpack roblox assigns when you join the game. Whatever is in the Starter Pack would replicate to this.

2 Likes

@Koriyoc
I already did that it’s not showing up there

1 Like

Yeah that is true. But his statement was kinda confusing when he said player.Parent = path

1 Like

What were you confused about? I was trying to try to figure out where to put the folder, but now I know.

1 Like

Oh ok then. If you have a solution, please mark whoever had helped you.

1 Like

@CoolGuyBoiBruh I still don’t have a solution. Do you see what’s wrong?

um you can’t change the name of the leaderstats folder or it won’t work.

I don’t need datastore.

And also that just gets rid of the boolvalue entirely should I make coins a boolvalue and change the name?

So then what are you doing? I need a general idea.

I’m making a checker to see if a player is in my group. Since yesterday from what I posted, this has been what it has been led up to. You can see the other post here.

I think leaderstats would be a great way to do that.

All unnecessary functions in this game (backpack,leaderboards, etc.) have been hidden

Hmmm, if it’s not working, this may be a solution but I’m not so sure.

script:

function playerAdded(player)
    local folder = Instance.new("Folder")
    folder.Name = "BoolValues"
    folder.Parent = player

	local value = Instance.new("BoolValue")
	value.Name = "ChillBool"
	value.Parent = folder
	value.Value = false
end

game.Players.PlayerAdded:Connect(playerAdded)
for _,player in pairs(game.Players:GetPlayers()) do
   spawn(function() playerAdded(player) end)
end

If you are trying to make a system to check to see if the player has a certain rank in your group or is in your group, you would make a folder parented to the players backpack.

1 Like

Alright I think it’s a good idea to rewrite the beginning of the script bc it’s gotten pretty bad. I’ll start with your example, @Koriyoc

game.Players.PlayerAdded:Connect(function(player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player
	
	local ChillBool = Instance.new("BoolValue")
	ChillBool.Name = "ChillBool"
	ChillBool.Parent = leaderstats
	ChillBool.Value=false
end)
local remoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("ChillRemoteEvent")
local Chill = false
local inGroup = false
print("Starting first check")



print("Starting check to see if player is in group")

                   
		print ("Player is in Weird Games, Inc.!" )   
		inGroup = true
	else
		print("First check to see if player was in group failed. Trying 10 times, once every second, to see if they are really in the group")
		for count = 1,10,1 do
			wait(1)
			if newPlayer:IsInGroup(6967967) then                    
				print ("Player is in Weird Games, Inc.!" )   
				inGroup = true
			end
		end
	end