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

Why can't I insert a folder in a player with a script?

I've been trying to insert a folder in the player when they join but its not working. No errors. This is the code:

function add(char)
	local perms = Instance.new('Folder')
	perms.Name = 'Permissions'
	perms.Parent = char
end

game.Players.PlayerAdded:Connect(add)

If you could help me out, thanks.

P.S: Script is in the workspace.

1 answer

Put your script in the ServerScriptService. Also the script supposed to be a Server Script, just so you know that.

function add(p)
    local char = p.CharacterAdded:Wait() --Find your character this way
    local perms = Instance.new('Folder')
    perms.Name = 'Permissions'
    perms.Parent = char
end

game.Players.PlayerAdded:Connect(function(p) --"p" is player
	add(p) --You play the function add and add a "p" to play it for the player
end)

I checked this, it works. If you have any issues ill try to help you.

Hope this helped. :)

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