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

is there a way to blacklist a certain user so that the script wont work on them?

I'm trying to make it so that only I have the "Owner" tag and everyone else has a "Player" tag. But most of the times i get a mix of owner and player, or the owner only pops up for me and everyone else doesn't have a player tag. How do i fix this?

this is the script

				local billboardgui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")
				        game.Players.PlayerAdded:Connect(function(player)
				            player.CharacterAdded:Connect(function(character)
				            if player.Name == "KingOfEpicness_1337" then
				                local clonedgui = billboardgui:Clone()
				             game:GetService("ServerStorage"):WaitForChild("Player"):WaitForChild("TextLabel").TextSize = 0
				                clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head
				                if not player.Name == "KingOfEpicness_1337" then
					            		local billboardgui = game:GetService("ServerStorage"):WaitForChild("Player")
					game.Players.PlayerAdded:Connect(function(player)
						player.CharacterAdded:Connect(function(character)
							game.GetService("ServerStorage"):WaitForChild("Player"):WaitForChild("TextLabel").TextSize = 40
							local cloned = billboardgui:Clone()
							cloned.TextLabel.Text = "Player"
							cloned.TextLabel.TextColor3 = Color3.fromRGB(36,154,165)
							cloned.Parent = game.Workspace:WaitForChild(player.Name).Head
						end)
						end)
			
				            end
				        end		    end)
				end)

1 comment

0

Your if statements should really be seperate and not nested. Further, they should just be if, then, else.

1 answer



local billboardgui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")
        game.Players.PlayerAdded:Connect(function(player)
            player.CharacterAdded:Connect(function(character)
            if player.Name == "KingOfEpicness_1337" then
                local clonedgui = billboardgui:Clone()
             game:GetService("ServerStorage"):WaitForChild("Player"):WaitForChild("TextLabel").TextSize = 0
                clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head
                if player.Name ~= "KingOfEpicness_1337" then
                        local billboardgui = game:GetService("ServerStorage"):WaitForChild("Player")
    game.Players.PlayerAdded:Connect(function(player)
        player.CharacterAdded:Connect(function(character)
            game.GetService("ServerStorage"):WaitForChild("Player"):WaitForChild("TextLabel").TextSize = 40
            local cloned = billboardgui:Clone()
            cloned.TextLabel.Text = "Player"
            cloned.TextLabel.TextColor3 = Color3.fromRGB(36,154,165)
            cloned.Parent = game.Workspace:WaitForChild(player.Name).Head
        end)
        end)

            end
        end         end)
end)


-- Fixed my answer

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