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

How do you make a gui say a message and have a variable in the message also?

I'm trying to make welcome GUI? I guess and I tried

(I'm using a Local Script in a GUI)

--Variabls--
local user = game.Players.LocalPlayer
local message = script.Parent.TextLabel
--Scripts--
message.Text = ("Welcome, "user)

and

--Variabls--
local user = game.Players.LocalPlayer
local message = script.Parent.TextLabel
--Scripts--
message.Text = ("Welcome, ", user)

and this

--Variabls--
local user = game.Players.LocalPlayer
local message = script.Parent.TextLabel
--Scripts--
message.Text = ("Welcome, ",user)

can anyone help me?

2 answers

✓ Accepted answer

I believe you are trying to concatenate here in your local script,

To concatenate use dots like this:

local message = script.Parent.TextLabel
message.Text = "Welcome, "..(stringvalue)

You are also trying to concatenate using only the player, you must use the name property of it as it returns a string value (text), completing it as:

local user = game.Players.LocalPlayer
local message = script.Parent.TextLabel
message.Text = "Welcome, "..user.Name

I think you should reference the player's Name instead of the player itself.

local user = game.Players.LocalPlayer
local message = script.Parent.TextLabel

message.Text = ("Welcome, ", user.Name)

Hope it works.

3 comments

0

forgot the .name lol

0

i did

0

Great.

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