How do you make a screen button gui thing that make so, for example, if you click it and you have a hunger script, it will raise your hunger? (Not just a normal button on the ground, it stays on your screen, right side of screen, and wherever you move your view, its on the screen with you.)
Note: I know how to insert a screen button, but how do you make so it effects your hunger, and raises your hunger when clicked?
put this in a script inside the TextButton. tell me if you need anything else on it.
1 | gui = script.Parent --first we find the gui button |
2 | hungerval = gui.Value -- then create a NumberValue in the TextButton |
3 | gui.MouseButton 1 Down:connect( function () -- and now when the event fires we will lower how hungey the player is. (e.g. 100 = not hungery, 50 = hungery, 1 = staving) |
4 | hungerval.Value = hungerval.Value - 15 --lower the hunger and boom |
5 | end ) |
I think you're talking about a GUI Button, that you'd have to have roblox studio for. Click edit on your game, then insert a GUI Button.. It's pretty simple seeing it. Although this isn't really scripting help.