Hello Devs!
I’m wondering why the Value isn’t changing when I pick a class.
Here is script:
--// Services
local plrs = game:GetService("Players")
local RepStor = game:GetService("ReplicatedStorage")
--// Variables
local ClassesFolder = RepStor.Classes
local Bg = script.Parent.Background
local Classes = Bg.Classes
local Scroller1 = Classes.ScrollingFrame
local Desc = Bg.Description
local Scroller2 = Desc.ScrollingFrame
local Primary = Scroller2.Primary
local Secondary = Scroller2.Secondary
local Melee = Scroller2.Melee
local Select = Scroller2.Select
local Loadout = script.Parent.Loadout
--// Functions
for i, clasSelected in pairs(Scroller1:GetChildren()) do
for i, class in pairs(ClassesFolder:GetChildren()) do
if clasSelected.Name == class.Name then
clasSelected.MouseButton1Click:Connect(function()
Primary.Text = tostring(class.Values.Primary.Value)
Secondary.Text = tostring(class.Values.Secondary.Value)
Melee.Text = tostring(class.Values.Melee.Value)
print(clasSelected.Name)
Loadout.Value = clasSelected.Name
Select.MouseButton1Click:Connect(function()
RepStor.TakeClass:FireServer(Primary.Text, Secondary.Text, Melee.Text)
end)
end)
end
end
end