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

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

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

1 comment

0

Also those ? are emojis that didn't post here

1 answer

✓ Accepted answer

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!

1 comment

0

Lol

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