#How i solve this bug?

29 messages · Page 1 of 1 (latest)

paper fossil
#
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)
/```
slate pilot
#

local allowedDevName = {'trialsgaming007XD', 'fer007'}

#

local BadgeService = game:GetService("BadgeService")

vague saddle
#

its probably a gui promlem not a scripting problem

slate pilot
#
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

vague saddle
#

bro its a gui problem

slate pilot
#

Ok niga how it is

earnest shaleBOT
#

studio** You are now Level 3! **studio

slate pilot
#

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()

calm linden
#

its a gui problem

mortal steppe
#

he needs to make a herarquy for name tags for the one that are most important than others

gray hound
#

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.

mortal steppe
#

if he wants to show more than one, then its more complicated

mortal steppe
gray hound
#

I know, just helping you for the future.

mortal steppe
gray hound
#

I understood what you meant though lol

mortal steppe
#

yeah i know im just trying to be clear as possible

gray hound
#
        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.

paper fossil
#

I fixed the code without Vectors