What I want to do:
I just create description TextLabel that shows description of an item from module when you click on it.
…and where the problem?
Basically, when I click on the button it logs in output:
The code:
module = require(game.ReplicatedStorage.Module.Tower)
for i,v in pairs(module) do
local ae = game.ReplicatedStorage.button:Clone()
ae.Parent = script.Parent.ScrollingFrame
ae.Name = v.Name
ae.ImageLabel.TextLabel.Text = v.Name
ae.ImageLabel.Image = v.Icon
ae.MouseButton1Click:Connect(function()
script.Parent.Tower.Value = v.Name
script.Parent.ImageLabel.Image = v.Icon
script.Parent.ImageLabel.TextLabel.Text = v.Name
script.Parent.desc = v.Desc
script.Parent.dmg = v.Dmg
script.Parent.rel = v.Rel
script.Parent.bul = v.Bullets
local cost = "<font color=\"#8000ff\">"..v.Cost.." PC</font>"
script.Parent.ImageLabel.TextLabel.Text = v.Name.." - "..cost.."."
script.Parent.Buy.Visible = true
print(v.Name)
end)
end
And, of course, it would be funny not to show content of “Shop”
…where you can CLEARLY see my HORRIBLE sorting skills and “desc” is in.
By the way, the script running in that LocalScript that I shew on screenshot.
Thank you for helping, even if you will try to!