Hello developers i remaked the my system rebirth, but it working only for 1 button
ScreenShot:
script:
cd = false
local plr = game.Players.LocalPlayer
local selecting = script.Parent.Parent.Selecting
local selected = script.Parent.Parent.Selected
local module = require(game.ReplicatedStorage.AbbreviateNumber)
for _, i in pairs(script.Parent:GetDescendants()) do
print(i.Name)
if i:IsA("TextButton") then
i.MouseButton1Click:Connect(function()
if selecting.Value == false then
print("ok")
if (plr.leaderstats.Rebirth.Value*i.priceadding.Value) +i.priceadding.Value <= plr.leaderstats.Clicks.Value then
game.ReplicatedStorage.Events.Rebirth:FireServer(i.rebirths.Value)
end
else
selecting.Value = false
selected.Value = i.Name
end
end)
while wait() do
if selecting.Value == false then
if (plr.leaderstats.Rebirth.Value*i.priceadding.Value) +i.priceadding.Value <= plr.leaderstats.Clicks.Value then
i.Text = i.rebirths.Value.." Rebirths BUY"
i.BackgroundColor3 = Color3.new(0.666667, 1, 0.498039)
else
i.Text = i.rebirths.Value.." Rebirths ".. module.abbreviate((plr.leaderstats.Rebirth.Value*i.priceadding.Value)+i.priceadding.Value)
i.BackgroundColor3 = Color3.new(0.501961, 0.760784, 1)
end
else
i.Text = i.rebirths.Value.." Rebirths Select"
end
end
end
end
any problems?