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

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

Asked by 4 years ago

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?

0
Where is the ModuleScript. Ziffixture 6913 — 4y
0
the module script is in the gui mahid786 41 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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! :)

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. Ziffixture 6913 — 4y
0
its just easier for me so dont worry about that, but yes i could change it. mahid786 41 — 4y
Ad

Answer this question