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

PUDBOTCodeEdit (ScreenGUI) is not a valid member of Part. How do I fix this error?

So I'm trying to make a programmable robot in ROBLOX that can do fun things but I come across this error and I do not know how to solve it.

local localadmin = {"GiveMeYourPudding"}

function OpenAccess()
	local PBCE = script.Parent.PUDBOTCodeEdit
	PBCE.Parent = game.StarterGui
end

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
	for i,v in pairs(localadmin) do
		if v == plr.Name then
			OpenAccess()
		end
	end
end)

This is a link to the picture of my Explorer (everything that is unnecessary to this I put into Lighting): https://cdn.discordapp.com/attachments/502963941979324435/520985404447653901/unknown.png

1 comment

0

My objective is if your username is on localadmin, the PUDBOTCodeEdit GUI comes up onto your screen.

1 answer

✓ Accepted answer
function OpenAccess()
    local PBCE = script.Parent.PUDBOTCodeEdit
    PBCE.Parent = game.StarterGui
end

Don't parent the gui in the game.StarterGui, clone and parent it in the playergui

function OpenAccess(plr)
    local PBCE = script.Parent.PUDBOTCodeEdit:Clone()
    PBCE.Parent = plr.PlayerGui
end

Like that.

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