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

Unable to describe question in title (Has to do with strings and such?) [SOLVED]

Asked by
NewGPU 36
5 years ago
Edited 5 years ago

Solved, silly me forgot that it doesn't get set until after so nevermind :)

Hello there, I was unable to describe the question in the title. Here it is. I have a script with the following

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Guns = ReplicatedStorage.Guns

local shopFunc = ReplicatedStorage:WaitForChild("ShopEvent")

local gunName = script.Parent.Parent.Title.Text

local gunPrice = Guns[gunName].Price.Value

and

local gunPrice = Guns[gunName].Price.Value

gives off an error with the following

15:43:26.170 - is not a valid member of Folder 15:43:26.171 - Stack Begin 15:43:26.171 - Script 'Player.NewGPU.PlayerGui.Shopping.Shopping.Purchase.LocalScript', Line 5 15:43:26.171 - Stack End

But the thing is all the variables do exist and are defined and local gunName = script.Parent.Parent.Title.Text does exist and so should local gunDesc = Guns[gunName].Description.Value would really appreciate some help.

Sorry if this was poorly worded.

Additional images: !ReplicatedStorage with the guns and values

0
Check that the gunName matches the tools name. Did you inc a space ect? only you can fix this as we do not know what the Text is. User#5423 17 — 5y
0
gunName is exactly like the gun names in ReplicatedStorage.Guns NewGPU 36 — 5y

Answer this question