Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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)
0
Your if statements should really be seperate and not nested. Further, they should just be if, then, else. MooMooThalahlah 421 — 6y

1 answer

Log in to vote
0
Answered by
Im345 6
6 years ago
Edited 6 years ago


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

Ad

Answer this question