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

[STRINGS] How do you print words inbetween text?

Asked by 7 years ago
Edited 7 years ago

For example, you have this:

x = "Player name = Hi. Player Value = 3. Player ID = 25167131."

How would you print 3?

0
Please enclose your code in the blocks created by the Lua button so we can better understand your request. antonio6643 426 — 7y
0
You could use the find function to retrieve the position, or use the match function to return it. (I recommend using the find function if you understand string manipulation.) TheeDeathCaster 2368 — 7y

1 answer

Log in to vote
0
Answered by
joalars2 107
7 years ago

I just kind of do this

x = "Player name = "..plr.Name..". Player Value = "..Value..". Player ID = "..plr.UserId.."."

The double dots lets you fit a variable into a string, and you can continue the string later on

Ad

Answer this question