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

how do i change a property in a script without knowing a players name?

so i wanted to make a script for a tag that says if your a normal player or dev or owner and i am suck at the part of trying to make it so that i don't need their username

this is all i have now

local billboardgui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")

game.Players.PlayerAdded:Connect(function(player)

player.CharacterAdded:Connect(function(character)

local clonedgui = billboardgui:Clone()

    clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head

	game.Workspace,player:Name.Head.BillboardGui.player.Text = "player"

	game.Workspace.superaryan2.Head.BillboardGui.player.TextColor3 = Color3.fromRGB(255,255,0)	

	game.Workspace.superaryan2.Head.BillboardGui.player.TextWrapped = true

	game.Workspace.superaryan2.Head.BillboardGui.player.TextStrokeColor3 = Color3.fromRGB(0,0,0)

    game.Workspace.superaryan2.Head.BillboardGui.player.TextStrokeTransparency = 0 
end)

end)

1 answer

game:GetService(“Players”).PlayerAdded:Connect(function(plr)
    id = game.CreatorId
    plr.CharacterAdded:Connect(function(char)
        local clone = game:GetService(“ServerStorage”).BillboardGui:Clone()
        clone.Parent = char.Head
        clone.Adornee = clone.Parent
        clone.PlayerName.Text = plr.Name — we can get the players name
        if plr.UserId == id then — if the creator join
            clone.PlayerName.Text = “[CREATOR] ”..plr.Name
        end
    end)
end)

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