Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make screen buttons?

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?

3 answers

✓ Accepted answer

put this in a script inside the TextButton. tell me if you need anything else on it.

gui = script.Parent--first we find the gui button
hungerval = gui.Value-- then create a NumberValue in the TextButton
gui.MouseButton1Down: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)
hungerval.Value = hungerval.Value - 15--lower the hunger and boom
end)

4 comments

0

It didn't work, but was i supposed to make a gui button? Please reply and tell me all the details. Also, am i supposed to put it in startergui? I am new at scripting so i don't know.

0

yes you need to do all that you asked.

0

Ok, but i tried to enter a gui button, by going on workspace and clicking insert basic object but it wasn't there :(

0

right click on StarterGui, mouse over "insert basic object" and click ScreenGui, then right click on the ScreenGui, mouse over "insert basic object" and click TextButton, then right click on the TextButton, mouse over "insert basic object" and click Script and put the script i gave you it the script you inserted.

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.

2 comments

0

Yes, i understand how to make the buttons, but how do you make it activate and make your hunger go up?

0

You need to make a script for that, we don't make scripts, we help you with them.

This discussion is preserved as it was. New answers, comments, and votes are closed.