Update: Cost was fixed but actual upgrade button doesnt work
This is the upgrade button script; it only takes away one upgrade worth and only adds one upgrade value
local player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
local debounce = false
script.Parent.MouseButton1Click:Connect(function()
if tonumber(script.Parent.Parent.TextBox.Text) ~= nil then
if player.Stats.Cash.Value >= player.Stats["Robux Upgrade"].Value * 30 * (tonumber(script.Parent.Parent.TextBox.Text)) and debounce == false then
debounce = true
player.Stats.Cash.Value = player.Stats.Cash.Value - player.Stats["Robux Upgrade"].Value * 30 * (tonumber(script.Parent.Parent.TextBox.Text))
player.Stats["Robux Upgrade"].Value = player.Stats["Robux Upgrade"].Value + tonumber(script.Parent.Parent.TextBox.Text)
wait(0.1)
debounce = false
end
end
end)
This is the cost script;
local Short = require(game.ReplicatedStorage.Short)
while wait() do
if tonumber(script.Parent.Parent.TextBox.Text) ~= nil then
script.Parent.Text = "Cost: " .. Short.en(player.Stats["Robux Upgrade"].Value * 30 * (tonumber(script.Parent.Parent.TextBox.Text)))
end
end
That was just for the cost to show properly but the actual upgrade button is broke
This is the upgrade button script; it only takes away one upgrade worth and only adds one upgrade value
local player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
local debounce = false
script.Parent.MouseButton1Click:Connect(function()
if tonumber(script.Parent.Parent.TextBox.Text) ~= nil then
if player.Stats.Cash.Value >= player.Stats["Robux Upgrade"].Value * 30 * (tonumber(script.Parent.Parent.TextBox.Text)) and debounce == false then
debounce = true
player.Stats.Cash.Value = player.Stats.Cash.Value - player.Stats["Robux Upgrade"].Value * 30 * (tonumber(script.Parent.Parent.TextBox.Text))
player.Stats["Robux Upgrade"].Value = player.Stats["Robux Upgrade"].Value + tonumber(script.Parent.Parent.TextBox.Text)
wait(0.1)
debounce = false
end
end
end)
This is the cost script;
local Short = require(game.ReplicatedStorage.Short)
while wait() do
if tonumber(script.Parent.Parent.TextBox.Text) ~= nil then
script.Parent.Text = "Cost: " .. Short.en(player.Stats["Robux Upgrade"].Value * 30 * (tonumber(script.Parent.Parent.TextBox.Text)))
end
end