Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
234 views
in Technique[技术] by (71.8m points)

Code problems (role name overhead) roblox studio lua

I am having a problem, what happens is that the "textlabel" is visible overhead of my player but for only 1 second when I press to change to team red and then it disappears, how can I solve this problem?

Code:

local Players = game:GetService("Players")
local Teams = game:GetService("Teams")

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        game.Teams.Redteam.PlayerAdded:Connect(function(player)
            script.BillboardGui.Frame.Visible = true
            print(player.Name .. " joined the game!")
            local groupId = "Captain"
            local guiClone = script.BillboardGui:Clone()
            guiClone.Parent = character.Head

            local textlabel = guiClone.Frame.TextLabel
            local groupRank = player:GetRoleInGroup(groupId)
            textlabel.Text = groupRank 
        end)
    end)
end)

I need to make the player have that "textlabel" with the role name overhead all the time he is in the red team

1

question from:https://stackoverflow.com/questions/65649482/code-problems-role-name-overhead-roblox-studio-lua

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...