Cant insert a folder into the player

Im trying to add a folder into the player so I can change certain things in there for my game only idk why it doesnt add a script into the player this is a local script inside of the starteplayerscripts

wait(1)
local player = game:GetService("Players").LocalPlayer
local character = player.Character
local function addfolder()
	local itemsFolder = Instance.new("Folder")
	itemsFolder.Name = "Items"
	itemsFolder.Parent = player
end

game.Players.PlayerAdded:Connect(addfolder)

1 Like

It’s because it’s a LocalScript. Anything done on the client, e.g. in a LocalScript, will only change for that client. You need to make the folder server-side, as well as edit it server-side, if you want it to not only change for that client.

local players = game:GetService("Players")

local function addFolder(player)
    local folder = Instance.new("Folder")
    folder.Name = "Items"
    folder.Parent = player
end

players.PlayerAdded:Connect(addFolder)

so if I understadn you correctly I have tyo put the script into the server script service and make it a module script?

Just a normal Script in the ServerScriptService would work. Don’t use a ModuleScript in this case.

1 Like

ah alr thx for the help I thought since it changed only something for the player I could use a local script inside the SPS

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.