I am trying to make it where when you click on a text button a value changes but I can't get it to work. here is the code
under the text button:
local button = script.Parent
function changevalue()
game.Workspace.spawnrate.Value = 2
end
button.mouseMouseButton1Click:Connect(changevalue)
I have tried int values and number values
the value is under workspace
PLEASE help

10 comments
@theking66hayday it did not work the value is not changing
could it be "screen gui" and or "textbutton" in line 5 of the first script
Try making a ScreenGui and put a TextButton in the ScreenGui and put a local script in The TextButton
If that doesn't work I will save it as a model and send it to u
please send me the model
ok
I updated my post
it only works in a new world so ima mess with my gui becuase i have many screen gui's :facepalm:
YESSSSSSSSSSSS I GOT IT TO WORK THANK YOU FOR THE HELP (I will mark as answer)
No problem happy to help