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

How do I store the value of a StringValue as a variable?

Asked by 2 years ago

local swordname = player.Data.SwordName.Value local sword = game:GetService("ReplicatedStorage"):WaitForChild("Items").sword:Clone()

I am trying to make a variable sword to be an item that is called the same as the value in player.Data.Sword.Value in a folder called items in replicated storage, however, I must get the name of the sword from a StringValue in the player called SwordName. The problem with the code above is that I cant use player.Data.Sword.Value as its not part of replicated storage.

I tried to find some solutions on how to do this but none of them would work for me. Please let me know if you have any idea on how to do this.

1 answer

Log in to vote
0
Answered by
Puppynniko 1059 Moderation Voter
2 years ago
local StringValue = StringValue.Value
Ad

Answer this question