Hi, i'm trying to write a script that makes a TextBox's text say a message followed by a variable.
I've tried loads of different ways to write what seems like the same thing.
local p = script.Parent.Parent.CarName while true do wait() script.Parent.Text = (("Welcome into this ")..(p)) end
also tried:
local p = script.Parent.Parent.CarName while true do wait() script.Parent.Text = "Welcome into this "..p end
and:
local p = script.Parent.Parent.CarName while true do wait() script.Parent.Text = ("Welcome into this "..p) end
Should be easy.... any help?
I believe your variable is incorrect. I do not know if CarName is something inside of your game, but assume you meant CarName , then you need to direct the script to the name of this so it may add it to your script.
local p = script.Parent.Parent.CarName.Name while true do wait() script.Parent.Text = "Welcome into this "..p end
If you actually mean Car and Name should have had a period in front, then:
local p = script.Parent.Parent.Car.Name while true do wait() script.Parent.Text = "Welcome into this "..p end
Future reference:
You don't need a parenthesis around your string. just doing script.Parent.Text = "Welcome into this "..p
will work. I believe parenthesis work as well, although I do not use them for what you're doing.