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

How to get a script to get a players name into a text box, Screen gui?

Asked by 9 years ago

So I have a script which when you enter displays a GUI, but how do I get it to display a custom message depending on your name, and then the name appears after "Hello (PLAYERNAMEHERE), welcome to...."

local playername = game.Players.NewPlayer
local admin1 = game.Players.Lukeb50
local admin2 = game.Players.SickAtHackers

function NewPlayer(Player)
    if NewPlayer == admin1 or admin2 then
            script.Parent.Text = "Hello (playername), you are an admin. Please say :help for the commands"
    end
    script.Parent.Text = "Hello (playername),Welcome to Vault-Tec Vault 111"

end

1 answer

Log in to vote
1
Answered by 9 years ago

You would use concation which is ..

local playername = game.Players.NewPlayer
local admin1 = game.Players.Lukeb50
local admin2 = game.Players.SickAtHackers

function NewPlayer(Player)
    if NewPlayer == admin1 or admin2 then
            script.Parent.Text = "Hello "..Player.name..", you are an admin. Please say :help for the commands"
    end
    script.Parent.Text = "Hello  "..Player.name..",Welcome to Vault-Tec Vault 111"

end

NewPlayer()
0
Nein.... TheHospitalDev 1134 — 9y
Ad

Answer this question