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

Im Trying To Make A Ranking System For My Member's GUI But Its Keeps Giving Me Errors?

So I Want To Make It So A Script That Requires The Ranks To The Members Gui From a ModuleScript And Put It Next To There Name Like This mahid786 [Owner/Creator] But Doesent Seem To Work . Here Is The Script In The ModuleScript:

local Elements = {}

Elements.Ranks = {
	["[Owner/Creator]"] = "mahid786";
	["[Developer]"] = "GameTime_Studio";
	["[Admins]"] = game:GetService("Players").LocalPlayer:GetRoleInGroup(2)
}

return Elements

And Here Is The Script In The Other Script:

local plr1 = game.Players.LocalPlayer
local players = game.Players
local left = game.Players.PlayerRemoving
local list = script.Parent.Scroll.Player:Clone()
local find = script.Parent.Scroll.Player
local rank = require(script.Parent.Parent.Parent.Ranks)
wait(0.02)
script.Parent.Scroll.Player:Destroy()


for _,target in pairs(players:GetPlayers()) do
	if target.PlayerGui:FindFirstChild('ScreenGui') then
		local added = list:Clone()
		added.Parent = script.Parent.Scroll
		added.Text = target.Name
		if target.Name == 'mahid786' then
			if added.Text == 'mahid786' then
				added.Text = rank.Ranks
			end
		end
		if target.Name == 'GameTime_Studio' then
			if added.Text == 'GameTime_Studio' then
				added.Text = 'GameTime_Studio '.. rank.Ranks["[Developer]"]
			end
		end
	end
end

It Keeps Saying Requested module experienced an error while loading And The Module Script Says ** Players.mahid786.PlayerGui.oofer_gang.Ranks:6: attempt to index nil with 'GetRoleInGroup'** Can Someone Please Help Me?

2 comments

0

Where is the ModuleScript.

0

the module script is in the gui

1 answer

Idk if it matters but on both like 4 and line 13 you're calling :clone() on the same thing... so you're doing :clone():clone() which cant be a good thing :P .... I'll keep reading at let you know if i see anything else! :)

2 comments

0

He's cloning an duplicated Object. The :Clone() method returns the replicated Instance, therefore he is essentially still calling Instance:Clone(), and instead being repetitive.

0

its just easier for me so dont worry about that, but yes i could change it.

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