#Similar to previous post, need help with giving devs tools.

1 messages · Page 1 of 1 (latest)

fervent latch
#

I previously asked for help after a script wouldn't give devs their tools, thing which i fixed, but now i'm working on the dev panel and i'm having a similar issue. I'm trying to get a tool when you press a button. Could anyone help?


local devs = {
    ["name"] = true,
    ["name"] = true,
    ["name"] = true,
    ["name"] = true,
    ["name"] = true
}

local function isDeveloper(player)
    return devs[player.Name] == true
end

script.Parent.Activated:Connect(function(player)
    if isDeveloper(player) then
        local tool = game.ServerStorage.Noclip:Clone()
        local backpack = player:FindFirstChildOfClass("Backpack")
        if backpack then
            tool.Parent = backpack
        else
            print(backpack)
        end
    end
end)```
vale yew
#

Like GUI or a click detector in a part?

fervent latch
#

gui

wooden gull
#

if you are working with the dev panel. then you should have a list of player that has an access to the gui.

#

and if they can open the gui it means they are a developer, no need to check wether they are a dev in your script

#

you can make a separate script for that if you want and same thing for spawning a tool

vale yew
#

Use replicated storage

fervent latch
void wigeon
fervent latch
#

idk

#

i should use strings for ids right

void wigeon
#
local Devs = {
     ID ,
     ID
     ...
}

print(table.find(Devs, ID)) -- If found, prints the ID, if not found, prints nil. It can be used in if statements -> if table.find(Devs, ID) then
void wigeon
fervent latch
#

ok

void wigeon
#

UserID is a number

fervent latch
#

what would ID be? literally just "ID"?

fervent latch
#

ok too lazy to change the ids to ID what am i doing wrong


local devs = {
    514850607,
    639791247,
    534602257,
    3887187095,
    457903196
}


Players.PlayerAdded:Connect(function(player)
    local tool = game.ReplicatedStorage.Noclip:Clone()
    local tool2 = game.ReplicatedStorage.Heal:Clone()
    local playerJoined = player.Name
    if     table.find(devs, player.userId) then
        local devPanel = game.ServerStorage.Dev:Clone()
        devPanel.Parent = player.PlayerGui
        game.ReplicatedStorage.BellSfxEvent:FireAllClients()
        player.CharacterAdded:Connect(function(character)
            if     table.find(devs, player.userId) then
                local backpack = player:FindFirstChildOfClass("Backpack")
                if backpack then
                    tool.Parent = backpack
                    tool2.Parent = backpack
                end
            end
        end)
    end
end)```
meager spokeBOT
#

studio** You are now Level 4! **studio

fervent latch
#

ok yeah nevermind i guess i'll just use server console commands or something

#

unless onoly i can use those

fervent latch
#

nevermind

#

i still need to figure out how to do it properly 😭

void wigeon
#

u can try using cmdr

fervent latch
#

cmdr?

fervent latch
#

@void wigeon sorry for ping but what's cmdr?

void wigeon
#

like

#

google

#

it

#

its a command bar

fervent latch
#

thats just not necessary i think

#

the only issue i have is with the tools

fervent latch
#

did some testing and turns out the event isn't even firing at all. what am i doing wrong???


local devs = {
    ["gespnet"] = true,
    ["fluppiepuppie"] = true,
    ["letsgohome1234"] = true,
    ["Raul932t"] = true,
    ["DemonMonitor"] = true
}

local function isDeveloper(player)
    return devs[player.Name] == true
end

script.Parent.Activated:Connect(function(player)
    if isDeveloper(player) then
        print("Noclip button activated")
        local tool = game.ReplicatedStorage.Noclip:Clone()
        local backpack = player:FindFirstChildOfClass("Backpack")
        if backpack then
            print(tool)
            print(tool.Parent)
            tool.Parent = backpack
        else
            print(backpack)
        end
    end
end)```
meager spokeBOT
#

studio** You are now Level 5! **studio

fervent latch
#

keep in mind this is a legacy run context server script under a gui button

fervent latch
#

so i got the event to work but now IsDeveloper() isn't working?

    ["gespnet"] = true,
    ["fluppiepuppie"] = true,
    ["letsgohome1234"] = true,
    ["Raul932t"] = true,
    ["DemonMonitor"] = true
}

local function isDeveloper(player)
    return devs[player.Name] == true
end
fervent latch
#

it says attempt to index number with 'Name'