Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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

0
My objective is if your username is on localadmin, the PUDBOTCodeEdit GUI comes up onto your screen. GiveMeYourPudding 64 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
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.

Ad

Answer this question