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

How to share Strings Between Scripts ?

Asked by 4 years ago

If _G can share variables between scripts , how about sharing strings , what do you call it ?

0
I agree with @Feahren, as _G works with the same type of script, can't cross-script. You could also use, if you understand how to use them, RemoteEvents to send signals from server to client or client to server. killerbrenden 1537 — 4y

3 answers

Log in to vote
2
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
4 years ago

As I said in my previous answer, which you haven't accepted—I did my work and it is rude to leave it—the global array _G can store variables, there is no difference between the datatypes you store in it, it works just the same.

_G.myString = "Hello World"

print(_G.myString)
1
This answer is perfectly legitimate... the OP doesn't seem to understand that variables can store strings... Rinpix 639 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

To share data between scripts, you should use a Value.

If you want to share strings between scripts, you would use a StringValue

0
There are also other types of values such as IntValue, BoolValue, and so on. Kataclysmix 23 — 4y
Log in to vote
-1
Answered by 4 years ago

Use the same thing but wrap it in tostring() ?

Answer this question