I tried to do this it didn't work so I believe that I did something wrong. (Yes its a local script.)
local stock = game.Players.LocalPlayer:WaitForChild("Stocks").ONE.Value
local cash = game.Players.LocalPlayer:WaitForChild("leaderstats").Cash.Value
local OPrice = game.Workspace.ONEVal.ONEPrice
local a = game.StarterGui.CashNStuff.Frame.Investments.Buy1
local stock = tonumber(a.Text)
a.Text = tostring(stock)
script.Parent.MouseButton1Click:connect(function()
if cash > OPrice.Value then
stock = stock + 1 and cash == cash - OPrice.value and a.Text == tostring(stock)
else print("Not enough cash")
end
end)
UPDATED still error

13 comments
but I need to see the text because the text is to show how many you have
wait nvm
i still need some help though
With? I'm a bit confused now...
well i feel like i messed up the first part local cash = game:GetService("Players"):WaitForChild("leaderstats"):WaitForChild("Cash")
and script.Parent.Parent.ImageLabel.TextLabel = script.Parent.Parent.ImageLabel.TextLabel.Text + 1
because i don't think you can add to text and i dont know how to fix that
Do you want to see what i'm making?
i fixed the local cash = game:GetService("Players"):WaitForChild("leaderstats"):WaitForChild("Cash")
and replaced with local cash = game.Players.LocalPlayer:WaitForChild("leaderstats").Cash.Value and local stock = game.Players.LocalPlayer:WaitForChild("Stocks").ONE.Value
Players.johner2000.PlayerGui.CashNStuff.Frame.Investments.TextButton.LocalScript:6: attempt to perform arithmetic on upvalue 'stock' (a boolean value) whats this mean?
BTW thank you for trying to help!
It means you can't add numbers with true or false (boolean)