Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How to make screen buttons?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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)
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. BreBreGaming 10 — 10y
0
yes you need to do all that you asked. chabad360 34 — 10y
0
Ok, but i tried to enter a gui button, by going on workspace and clicking insert basic object but it wasn't there :( BreBreGaming 10 — 10y
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. chabad360 34 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

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.

0
Yes, i understand how to make the buttons, but how do you make it activate and make your hunger go up? BreBreGaming 10 — 10y
0
You need to make a script for that, we don't make scripts, we help you with them. PiggyJingles 358 — 10y
Log in to vote
-1
Answered by
Marolex 45
10 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.

MOUSE CLICK

Answer this question