while true do
script.Parent.Text = "cost:" ..script.Parent.textval.Value .." cps + .1"
wait()
end
i have others like this, but the others dont have a decimal point. so i took of the decimal, and it didnt work. theres nothing in the output about it. why do the others work, but this one doesnt?
this is just the text script, heres the upgrade script:
playerWhoClicked = game.Players.LocalPlayer
price = 15
increase = 3
script.Parent.MouseButton1Down:connect(function()
if playerWhoClicked.Character:FindFirstChild("Humanoid") then
local playerWhoClicked = game.Players:GetPlayerFromCharacter(playerWhoClicked.Character)
if playerWhoClicked.leaderstats.Cookies.Value >= price then
playerWhoClicked.leaderstats.Cookies.Value = playerWhoClicked.leaderstats.Cookies.Value - price
price = price + increase
script.Parent.textval.Value = script.Parent.textval.Value + increase
playerWhoClicked.leaderstats.Cps.Value = playerWhoClicked.leaderstats.Cps.Value + .1
while wait(10) do
playerWhoClicked.leaderstats.Cookies.Value = playerWhoClicked.leaderstats.Cookies.Value + 1
end
end
end
end)
this will give me .1 cps, subtract ten cookies, and then start giving me cookies.this script works fine, it the text one that has the issue.

7 comments
There shouldn't be a space in between "cost"..script.Parent.textval.Value.." cps + .1". So no spaces in between the double decimals. Add the spaced in the string values instead.
The whitespace between string concatenations won't matter.
the spacing doesnt matter, i have one EXACTLY like this, and it works. this one is just glitching up for some reason. i thought that somebody might knwo a fix
I don't see how this wouldn't work. Mind showing the rest of the script?
sure
Where is the first part of the script located? It it's below the wait(10) loop, then that may be the issue.
these are two scripts, both inside of an image button, inside of a frame, inside of a screen gui, inside of starter gui, inside of game