Hi!
Over a yeatr ago now, I made this nameteg.
It was ugly, so I decided to change it.
Now inspired by Bloxburg, I made this.
How would I make this code work with it?
Thanks!
local time = 0
local gamePassID = 15484617
local gamePassID2 = 13992448
local MarketplaceService = game:GetService("MarketplaceService")
local function onPlayerAdded(character)
local head = character:WaitForChild("Head")
local old = script.NameDisplay:Clone()
old.Parent = head
local tag = head:WaitForChild("NameDisplay")
local player = game:GetService("Players"):GetPlayerFromCharacter(character)
local hasPass = false
local hasOtherPass = false
local increment = 1
local head = character:WaitForChild("Head")
local tag = head:WaitForChild("NameDisplay")
-- Check if the player already owns the game pass
local success, message = pcall(function()
hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID)
end)
local success1, message1 = pcall(function()
hasOtherPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID2)
end)
-- If there's an error, issue a warning and exit the function
if not success then
warn("Error while checking if player has pass: " .. tostring(message))
return
end
--MAKE TAGZ
wait (4)
if hasPass then
coroutine.wrap(function()
while true do
increment = 2
wait (1)
time += increment
tag.PlayerName.Text = player.DisplayName.. "(@"..player.Name..")..| ⏰"..time.."|"..player:GetRoleInGroup(9257320).."|".."X2 ACTIVE" -- set the time's text
end
end)()
elseif hasOtherPass then
coroutine.wrap(function()
while true do
increment = 2
wait (1)
time += increment
tag.PlayerName.Text = player.DisplayName.. "(@"..player.Name..")..| ⏰"..time.."|"..player:GetRoleInGroup(9257320).."|".."OG Player" -- set the time's text
end
end)()
else
coroutine.wrap(function()
while true do
wait (1)
time += increment
tag.PlayerName.Text = player.DisplayName .. "(@"..player.Name..")".."| ⏰".. time .. "|" .. player:GetRoleInGroup(9257320) -- set the time's text
end
end)()
end
end
onPlayerAdded(script.Parent)