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

How would I be able to fix this in my TitleModule?

Asked by 4 years ago
Edited 4 years ago

So I have been making Chat Roles for YouTubers that want one on my Roblox game and I made a Chat role called VIP and when ever they buy vip they don't have there Chat Role I made them anymore, same with my Owner role since I own the VIP role I somehow get the VIP role instead of owner any answers would be help full heres my script

local ms = game:GetService("MarketplaceService")
local gs = game:GetService("GamePassService")
local gc = game:GetService("ReplicatedStorage"):WaitForChild("gamepassChecker")

local gamepasses = { 
    [6285119] = {title = '????VIP????', priority = 10, color = Color3.fromRGB(255, 255, 0), color0 = Color3.fromRGB(248, 248, 248), font = Enum.Font.SciFi},
}

local players = {
    [606970529] = {title = '????SnuggleBunny????', priority = 4, color = Color3.fromRGB(255, 0, 191), color0 = Color3.fromRGB(4, 175, 236), font = Enum.Font.SciFi},
    [232929746] = {title = '????UnicornKitty????', priority = 4, color = Color3.fromRGB(255, 0, 191), color0 = Color3.fromRGB(255, 176, 0), font = Enum.Font.SciFi},
    [846331315] = {title = '????Snuggie????', priority = 4, color = Color3.fromRGB(255, 0, 191), color0 = Color3.fromRGB(4, 175, 236), font = Enum.Font.SciFi},
    [146565263] = {title = '??Roxers??', priority = 4, color = Color3.fromRGB(170, 0, 170), color0 = Color3.fromRGB(4, 175, 236), font = Enum.Font.SciFi},
    [78574122] = {title = 'Friends', priority = 4, color = Color3.fromRGB(255, 0, 191), color0 = Color3.fromRGB(255, 0, 191), font = Enum.Font.SciFi},
    [166724867] = {title = 'Admin', priority = 4, color = Color3.fromRGB(151, 114, 165), color0 = Color3.fromRGB(255, 255, 255), font = Enum.Font.SciFi},
    [6285119] = {title = '????OWNER????', priority = 10, color = Color3.fromRGB(0, 255, 255), color0 = Color3.fromRGB(0, 255, 0), font = Enum.Font.SciFi},
    [71994295] = {title = 'Developer', priority = 4, color = Color3.fromRGB(151, 114, 165), color0 = Color3.fromRGB(255, 255, 255), font = Enum.Font.SciFi}
}

local saves = {}

function sendInfo(player)

    local info = saves[player.UserId] 
    if not info then -- we don't want to keep inquiring their title because it floods the chat >:(

        local priority = 0

        for key, value in pairs(gamepasses) do
            if gc:InvokeServer(player, key) == true and value.priority > priority then
                print(player.Name .. ' owns gamepass '..tostring(key))
                info = {title = value.title, color = value.color, color0 = value.color0, font = value.font}
                priority = value.priority
            end
        end 

        for key, value in pairs(players) do
            if player.UserId == key and value.priority > priority then
                info = {title = value.title, color = value.color, color0 = value.color0, font = value.font}
                priority = value.priority
            end
        end 

        if info == nil then

            info = {title = 'Guest', priority = 4, color = Color3.fromRGB(255, 169, 228), color0 = Color3.fromRGB(255, 255, 255), font = Enum.Font.SciFi}
        end 

        saves[player.UserId] = info
        return info

    else

        return info

    end

    end

return sendInfo
0
Also those ? are emojis that didn't post here DuckyRobIox 280 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Alright so how you'd do this is fairly simple. Just have an if statement when checking if the player has vip, check if their userid is found in the players table, and if not, THEN give them the vip tag. Easy!

0
Lol Sapppower 17 — 4y
Ad

Answer this question