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

How to share Strings Between Scripts ?

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

1 comment

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.

3 answers

✓ Accepted answer

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 comment

1

This answer is perfectly legitimate... the OP doesn't seem to understand that variables can store strings...

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

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

1 comment

0

There are also other types of values such as IntValue, BoolValue, and so on.

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