i just have a simple question, how do i properly get every variable from a modulescript so i get every variable’s name to copypaste every name to the “shopgui”
it somewhat works, but it only does the first value, i want it to do every value from the modulescript (sorry if this is so hard to read)
ModuleScript
local stts = {
["GLOCK17"] = {
Name = "GLOCK17",
Damage = 12,
HeadDamage = 30,
Cost = 600,
Ammo = 18
};
["AK47"] = {
Name = "AK47",
Damage = 15,
HeadDamage = 50,
Cost = 2500,
Ammo = 30
};
["M4 CARBINE"] = {
Name = "M4A1",
Damage = 15,
HeadDamage = 45,
Cost = 1500,
Ammo = 40
};
["XM1014"] = {
Name = "XM1014",
Damage = "DEPENDS",
HeadDamage = "DEPENDS",
Cost = 1000,
Ammo = 8
};
["SVD"] = {
Name = "SVD",
Damage = 70,
HeadDamage = 120,
Cost = 1000,
Ammo = 8
};
}
return stts
the localscript
local event = game:GetService("ReplicatedStorage"):WaitForChild("EventsNotRelatedToCombat"):WaitForChild("UIShop")
local mod = require(workspace.tempmobilepurchasegui.Stats)
local ui = game:GetService("ReplicatedStorage"):WaitForChild("Name")
event.OnClientEvent:Connect(function()
for i, v in pairs(mod) do
local new = ui:Clone()
ui.Parent = script.Parent.Main.d
ui.Name = v.Name
ui.Text = v.Name
end
end)
i tried doing #mod, but it didn’t work