local allowedDevNames = {"trialsgaming007XD", "fer007"}
local BadgeService = game:GetService("BadgeService")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
--Varibles
local head = char.Head
local rep = game:GetService("ReplicatedStorage")
local nametag = rep:FindFirstChild("NameTag")
if not nametag then
error("nametag object not found in ReplicatedStorage")
elseif not nametag.Clone then
error("nametag object does not have a Clone function")
end
local newtext = nametag:Clone()
local namtext = newtext.NameText
local betatext = newtext.BetaText
local devtext
if not newtext:FindFirstChild("DevText") then
error("DevText object not found in nametag clone")
else
devtext = newtext.DevText
end
local humanoid = char.Humanoid
humanoid.DisplayDistanceType = "None"
--Main Text
newtext.Parent = head
newtext.Adornee = head
namtext.Text = player.Name
--Check if player has badge using pcall
local success, hasBadge = pcall(function()
return BadgeService:UserHasBadgeAsync(player.UserId, 2130424479)
end)
if success then
if hasBadge then
betatext.Text = "Beta Tester"
betatext.TextColor3 = Color3.fromRGB(255, 128, 0)
end
else
-- handle some errors
print("Error checking badge: " .. tostring(hasBadge))
end
--Check if player is in allowedDevNames table
for i,name in ipairs(allowedDevNames) do
if name == player.Name then
devtext.Text = "Dev"
devtext.TextColor3 = Color3.fromRGB(255, 0, 0)
break
end
end
end)
end)
/```
#How i solve this bug?
29 messages · Page 1 of 1 (latest)
local allowedDevName = {'trialsgaming007XD', 'fer007'}
local BadgeService = game:GetService("BadgeService")
its probably a gui promlem not a scripting problem
local allowedDevNames = {"trialsgaming007XD", "fer007"}
local BadgeService = game:GetService("BadgeService")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
--Varibles
local head = char.Head
local rep = game:GetService("ReplicatedStorage")
local nametag = rep:FindFirstChild("NameTag")
if not nametag then
error("nametag object not found in ReplicatedStorage")
elseif not nametag.Clone then
error("nametag object does not have a Clone function")
end
local newtext = nametag:Clone()
local namtext = newtext.NameText
local betatext = newtext.BetaText
local devtext
if not newtext:FindFirstChild("DevText") then
error("DevText object not found in nametag clone")
else
devtext = newtext.DevText
end
local humanoid = char.Humanoid
humanoid.DisplayDistanceType = "None"
--Main Text
newtext.Parent = head
newtext.Adornee = head
namtext.Text = player.Name
--Check if player has badge using pcall
local success, hasBadge = pcall(function()
return BadgeService:UserHasBadgeAsync(player.UserId, 2130424479)
end)
if success then
if hasBadge then
betatext.Text = "Beta Tester"
betatext.TextColor3 = Color3.fromRGB(255, 128, 0)
end
else
-- handle some errors
print("Error checking badge: " .. tostring(hasBadge))
end
--Check if player is in allowedDevNames table
for i,name in ipairs(allowedDevNames) do
if name == player.Name then
devtext.Text = "Dev"
devtext.TextColor3 = Color3.fromRGB(255, 0, 0)
break
end
end
end)
end)
/```
Naaaahhh im to lazy to fix cause im on Phone sorry H
g
G
bro its a gui problem
Ok niga how it is
** You are now Level 3! **
Its script problem
He got beta tag and fukin dev tag at same time
He need to check If dev players have a beta tag in tje script and If they do he needs to :destroy()
he wants it to be on top
its a gui problem
he needs to make a herarquy for name tags for the one that are most important than others
I'd imagine it's conditional somewhat, so he'd need to alter the GUI based on some logic like a character being part of both groups.
Hierarchy
if he wants to show more than one, then its more complicated
english is not my main language
I know, just helping you for the future.
thanks
I understood what you meant though lol
yeah i know im just trying to be clear as possible
if success then
if hasBadge then
betatext.Text = "Beta Tester"
betatext.TextColor3 = Color3.fromRGB(255, 128, 0)
-- moves dev tag up
newText.StudsOffset += Vector3.new(0, 1, 0) -- edit me
end
else
-- handle some errors
print("Error checking badge: " .. tostring(hasBadge))
end
So if the player ends up having the BetaTester badge, the dev tag will get pushed up a stud.
Feel free to adjust that if needed.
I fixed the code without Vectors