How I make a Admin Script? Part 2

Datastores security be like:

yeah it sucks

it’s not a violation of TOS, but you just can’t store data on Google Sites. Not possible

and that’s all you got from what i said lmao.

Before you solve this problem of how to ban exploiters, have you considered if this is actually a problem for you? Do you have a popular game that is being exploited?

From what I see you’re attempting to do, it doesn’t make much sense to me. If someone was exploiting, they wouldn’t likely be using your admin tools that you made. And even if they were, they’d probably be adding that after they join, not before, so checking ‘playeradded’ won’t be useful.

In other words, if you want to learn how to make your own admin script, I’d suggest moving on with making some commands that actually do something useful for you and not get hung up on making it bullet proof from exploiters.

1 Like

i dont have a popular game being exploited, i dont want my game be exploited because a small exploit to a big problem so i want to prevent that from happening in the future.

I get that, but you could worry about securing the script after you make a useful script. That’s just he way I would want to do it. Get the basics down before you try to tackle advanced topics? That my opinion, do what you like. :slight_smile:

If your script that is handling the events generated by your admin gui is checking the admin list there is no reason to care if an exploiter has cloned your admin gui.

That does not change the security at all… You can literally use this to bypass that…

for i,v in pairs(MainFolder:GetDescendants()) do
 if v.Name == "Example" and v:IsA("Example") then
  --Code Here
 end
end

I’m gonna make 2 scripts, which one the scripts have a folder with the player userid and name
and the other script is gonna store the data
(also the folder is gonna be in serverstorage because exploiters cant access that)

Hey, (late to the party but) what’s inside the Ranks? strings (name) or numbers (userid)

return {
	Ranks = {
		[3236301256] = true
	}
}

asss

return {
	Ranks = {
		3236301256
	}
}

And the main script to this:

local admins = require(script.Parent.Settings).Ranks

function IsAdmin(player)
    for _, v in pairs(admins) do
        if v:lower() == player.Name:lower() then
            return true
        end
    end
    
    return false
end

game.Players.PlayerAdded:Connect(function(player)
    if IsAdmin(player) == true then
        local ui = script.AdminGUI:Clone()
        ui.Parent = player.PlayerGui
    end
    
    player.PlayerGui.ChildAdded:Connect(function(child)
        if child:IsA("ScreenGui") and child.Name == "theAdminGuiName" and if IsAdmin(player) == false then
            player:Kick("Reason: \n Exploiting to AdminScreen. \n Kicked By System")
        end
    end)
end

(make sure to change the gui name btw)

1 Like

uhhhhhh

1 Like

Whoops, my bad! Remove the if and change “theAdminGuiName” to your admin gui name. Here:

Should i do:

child.Name == script.AdminGUI.Name

?

If the admingui name is changed and is added to the player it wont kick them

Ok here, change that if statement to

if child:IsA("ScreenGui") and child.Name == "AdminGUI" and IsAdmin(player) == false then

No, not that what i was talking, i was talking this:

player.PlayerGui.ChildAdded:Connect(function(child)
		if child:IsA("ScreenGui") and child.Name == script.AdminGUI.Name and IsAdmin(player) == false then
			player:Kick("Reason: \n Exploiting to AdminScreen. \n Kicked By System")
		end
	end)

I’m confused but at least the script looks alright now.

i changed child.Name == “AdminGUI” to child.Name == script.AdminGUI.Name

Yeah, works

chars

  •   -
    

__/