When pressed on the button it is not going 0

Hello, I am beginner coder
and I have a problem so there are 2 buttons first is button 1 and button 2 so when I press button 1 it would give me 30$ (because if the boost is not applied then it is 1$) but when I purchase a new button for 1000$ and if I would press on it, it gives me 1000$ instantly rather than giving me 10$ per presses
I want that when the player touches it it would give him 10$ rather than 1000$ instantly and from nowhere



2 Likes

wait, i think its giving you 1k because you have the 3x boost because 10³ is 1000

1 Like

Hey it did not put the boost for button 2 I only added it for button 1

2 Likes

I assume this is button 2 script


You have the locals still there so I’d assume the 3x is working on button 2

1 Like

there seems to be no bounce on your touched function so it might be called 30x per second.

1 Like

Did you remove the 1000$ in a server script? If you did it in a local script then it won’t replicate, causing the server to give you 1000$ out of nowhere

1 Like

I did it in server? is that is why it is getting replicated? How can I fix it?

1 Like

Uhh no 3x are all working only on button 1 not button 2

1 Like

I tested it out before also but it did not happen like that? And how can I make bounce ?

1 Like
local bounce = false
function ontouched(hit)
if bounce then return end
bounce = true
--your stuff here
wait(.5)
bounce = false
end

Try add something like that.
Also make sure ur not spawnin 100 buttons :stuck_out_tongue:

1 Like

Try changing the cost of the button, if it instantly gives you that amount then it’s a replication problem.
Make sure the button purchase script is in ServerScriptService (or some part in workspace). View the Cash value on the server after purchasing the button and after touching the button.

1 Like

It’d be nice if u did

Placed script like this.
1 Like

yeah sorry i would do it next time :wink:

1 Like

the script is in the part itself but it is also replicating?

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.