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

How do I make a customable banner instead of the plain black and black message? (Is it to hard?)

Asked by 9 years ago

Here's my code. I want it to have different colors, text, flashing text, textbox, etc. Thanks in advance.

1game.Players.PlayerAdded:connect(function(player)
2if player.Name == "jmotoyama" then
3local f = Instance.new("TextBox", game.Workspace)
4    f.Text = "Never fear, Jm the FT God is here."
5    wait(4)
6    f:Remove()
7    wait(1)
8end
9end)
1game.Players.PlayerAdded:connect(function(player)
2if player.Name == "qitsi" then
3local f = Instance.new("Hint", game.Workspace)
4    f.Text = "qitsi, the Tower Tormentor has arrived."
5    wait(4)
6    f:Remove()
7    wait(1)
8end
9end)
1game.Players.PlayerAdded:connect(function(player)
2if player.Name == "Tentameans" then 
3local f = Instance.new("Hint", game.Workspace)
4    f.Text = "Tentameans, the center/flat God has arrived."
5    wait(4)
6    f:Remove()
7    wait(1)
8end
9end)
1game.Players.PlayerAdded:connect(function(player)
2if player.Name == "EnterTime" then 
3local f = Instance.new("Hint", game.Workspace)
4    f.Text = "EnterTime, Best SF'er is here. "
5    wait(4)
6    f:Remove()
7    wait(1)
8end
9end)
1game.Players.PlayerAdded:connect(function(player)
2if player.Name == "iHateDex298" then 
3local f = Instance.new("Hint", game.Workspace)
4    f.Text = "Stand in the fire, DPS higher. iHateDex298 has arrived."
5    wait(4)
6    f:Remove()
7    wait(1)
8end
9end)
1game.Players.PlayerAdded:connect(function(player)
2if player.Name == "PestLine" then 
3local f = Instance.new("Hint", game.Workspace)
4    f.Text = "Hakuna Matata. PestLine has arrived."
5    wait(4)
6    f:Remove()
7    wait(1)
8end
9end)

3 answers

Log in to vote
1
Answered by 9 years ago

You would have to learn how to make a Gui. Making a Gui is quite easy and you don't have to know any code to do it. However, to make that Gui functional, you will have to learn a bit of code. Here is a basic tutorial on making some Gui's. Now, as for the code part, I can help you out with that.

Have this script in the Workspace as a normal script:

1p=Instance.new("StringValue", game.Workspace)
2p.Name="NewPlayer"
3 
4game.Players.PlayerAdded:connect(function(player)
5p.Value=player.Name
6end)

Now, put this script inside the TextLabel that you have inside the StarterGui that you have made that you want the text to show who entered the game (I recommend this being a local script):

01p=game.Workspace:WaitForChild("NewPlayer")
02script.Parent.Text=p.Value.." has entered the game!"
03wait(5)
04script.Parent.Visibel=false
05 
06p.Changed:connect(function()
07script.Parent.Visible=true
08script.Parent.Text=p.Value.." has entered the game!"
09wait(5)
10script.Parent.Visible=false
11end)

Now, this is a basic way to show that someone has entered the game. This might need some work done on the code but it should work perfectly for now.

Ad
Log in to vote
0
Answered by 9 years ago

To do that, you should use GUIs. Hints are (unfortunately) deprecated, and not flexible enough for your needs.

Also, instead of connecting separate events for each condition, simply use:

1if x then
2    ...
3elseif y then
4    ...
5elseif z then
6    etc...
7end

It's cleaner, and, from my experience, much faster.

EDIT: To do that, you would first make a ScreenGui in the StarterGui. Then, you should use TextLabels instead of hints. These need to be placed in every player's PlayerGui, in the ScreenGui. The ScreenGui is copied to the PlayerGui, in case you're wondering.

1for i, v in ipairs(game.Players:GetChildren()) do
2    local Label = Instance.new("TextLabel", v.PlayerGui.ScreenGui)
3    Label.Size = UDim2.new(1, 0, 0.05, 0)
4    Label.Text = "Insert text here"
5    -- Modify other properties here.
6end

I've also set the position to a decent value. You can see all the properties of the TextLabel here. For example, to change the background colour, we do this:

1Label.BackgroundColor3 = Color3.new(1, 0, 1) -- A purple colour

I hope this helps.

Log in to vote
-2
Answered by 9 years ago

Not experienced in coding. How do I put the GUI in? And also, how do I make the GUI center in minimized or maximized screen?

Answer this question