Code Monkey home page Code Monkey logo

hdadminv2's Introduction

Important update 2021

This repository does not reflect the latest code from HD Admin, you can find that instead at the MainModule.

HD Admin was a passion project I began working on all the way back in 2016, almost 5 years ago now. It’s been overwhelming to see the positive reception and uptake of the application, however to say it was outdated would be a slight understatement.

While I still provide regular bug-fixes/patches for HD Admin, you may have noticed we haven’t added new features or commands for a few years now. This is because over the last 2 years we’ve been working towards a new administration system to release 2021 - Nanoblox. You can follow our progress at github.com/nanoblox.

~ Ben (ForeverHD)


Rojo
 

HD Admin is an open-source admin application for the Roblox platform. It is comprised of an extensive range of features and commands designed to enhance games for both player and developer.


Resources


Tutorials


API

Retrieving HD

local hdMain = require(game:GetService("ReplicatedStorage"):WaitForChild("HDAdminSetup")):GetMain()
local hd = hdMain:GetModule("API")

Key Parameters

  • player - the player instance (e.g. local player = game:GetService("Players").ForeverHD)
  • rank - the rankId or rankName (e.g. 1 or "VIP")
  • rankType - determines the duration the player keeps their rank for:
    • "Perm" - for all servers for an infinite period of time
    • "Server" - for the server the rank is given in until the server ends
    • "Temp" - for the server the rank is given in until the player leaves

Methods

Server

hd:SetRank(player, rank, rankType)

Sets the Rank and RankType for the specified player. Example: hd:SetRank(player, "Mod", "Perm")

hd:UnRank(player)

Sets the Rank to 0 (NonAdmin) and clears the RankType for the specified player. Example: hd:UnRank(player)

hd:GetRank(player)

Returns the rankId, rankName and rankType for the specified player. Example: local rankId, rankName, rankType = hd:GetRank(player)

hd:DisableCommands(player, boolean)

Disables the ability to use commands for the specified player when set to true. Example: hd:DisableCommands(player, true)


Client

hd:SetTopbarTransparency(number)

Sets the transparency of the HD Topbar. Example: hd:SetTopbarTransparency(0.5)

hd:SetTopbarEnabled(boolean)

Hides and disables the HD Topbar when set to false. Example: hd:SetTopbarEnabled(false)


Shared

hd:GetRankName(rankId)

Returns the corresponding rankName from the given rankId. Example: local rankName = hd:GetRankName(1)

hd:GetRankId(rankName)

Returns the corresponding rankId from the given rankName. Example: local rankId = hd:GetRankId("VIP")

hd:Notice(player, message)

Displays a notification to the specified player. If used on the client, 'player' must be the LocalPlayer. Example: `hd:Notice(player, "Hello world!")'

hd:Error(player, message)

Displays an error notification to the specified player. If used on the client, 'player' must be the LocalPlayer.. Example: hd:Error(player, "Error!")


API Examples

Invisible TopBar

--In a Local Script
local hdMain = require(game:GetService("ReplicatedStorage"):WaitForChild("HDAdminSetup")):GetMain()
local hd = hdMain:GetModule("API")
hd:SetTopbarTransparency(1)
Invisible TopBar

Admin Pad

--In a Server Script

--Retrieve API
local hdMain = require(game:GetService("ReplicatedStorage"):WaitForChild("HDAdminSetup")):GetMain()
local hd = hdMain:GetModule("API")

--Define the rank-to-reward and setup the corresponding rankId and rankName
local rank = "Mod"
local rankType = "Server"
local rankId = tonumber(rank) or hd:GetRankId(rank)
local rankName = hd:GetRankName(rankId)

--Define debounce
local touchDe = {}

--Touch event ('touchPart' is the part players have to step on to receive the rank) 
touchPart.Touched:Connect(function(hit)
	
	--Check for character and player
	local character = hit.Parent
	local player = game:GetService("Players"):GetPlayerFromCharacter(character)
	if player and not touchDe[player] then
		
		--Setup debounce for player
		touchDe[player] = true
		
		--Check rank is lower than giver rank
		local plrRankId, plrRankName, plrRankType = hd:GetRank(player)
		if plrRankId < rankId then
			--Give rank
			hd:SetRank(player, rankId, rankType)
		else
			--Error message
			local errorMessage = "Your rank is already higher than '"..rankName.."'!"
			if plrRankId == rankId then
				errorMessage = "You've already been ranked to '"..rankName.."'!"
			end
			hd:Error(player, errorMessage)
		end
		wait(1)
		
		--End debounce
		touchDe[player] = false
	end
end)

You can take a completed copy here.


Get In Touch

hdadminv2's People

Contributors

1foreverhd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.