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

GUI doesn’t support string and variable?

Asked by 5 years ago
Edited 5 years ago

I have a screengui that is supposed display “intermission-30” and so on but when I do

Number = 30
Script.parent.Text = “intermission”Number

It doesn’t work. Is there something I’m missing? EDIT: by it doesn’t work I mean it displays “intermission” but nothing else

2
So I would put “Intermission” .. Number. I see. Can you make this an answer? I want to give you reputation when I add it in. Noonekirby 162 — 5y
1
Tyvm! ^^ TheeDeathCaster 2368 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

This answer's to be used as a reference

Hello there. :p It's me! :D

The solution to your question's to use concatenation, where the Dev Hub defines it as an "implicit or automatic conversion of a value from one type to another".

Alrighty, I think that's good enough...

WAIT JUST A MOMENT!

Ack, oh no!

Give an example on how to use concatenation!

Ok. ;-;

An example of how to use concatenation's the following;

local HelloStringExample = 'Hello '
local WorldStringExample = 'World!'

print(HelloStringExample .. WorldStringExample) --> Hello World!

When using concatenation, you can even use numbers and booleans;

print('2 + 2 is ' .. 4 .. ' is ' .. tostring(true)) --> 2 + 2 is 4 is true

And that should be it. Right?

Yes.

Yay! :D

Stuff talked about or touched on

  1. Concatenation - Best way I can describe it's that that it combines two or more values together.

  2. Tostring - Converts a value into a string.

  3. Booleans - true/false :p

I recommend using the website's search engine to try and find similar questions by past users.

I hope this helped. :D If you have any questions, feel free to contact me. :)

0
I apologize if this answer wasn't explained the best. TheeDeathCaster 2368 — 5y
1
No its perfect! I liked the way you presented information and summarized it! I wish I could upvote more! Noonekirby 162 — 5y
1
Tyvm. :) Means a lot. :D TheeDeathCaster 2368 — 5y
Ad

Answer this question