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

How do you make a calculator screen GUI?

I have made a screen GUI that looks like this:

Enter Total here(Textbox) Enter(TextButton) Total(TextLabel)

I want that when you press enter it multiplies your number in enter total here by 0.13 and then print the answer in Total. I am very new to scripting and am not very sure where to start. I don't know how to reference variables and numbers yet.(Don't laugh at me :p)Am I on the right path?

(The GUI is called CashierGUI) Here is a copy of my script:

connect:game.Workspace.StarterGUI.CashierGUI.Enter(function() if Enter.MouseButton1click:connect(function()=true then (Answer) *0.13 draw.Total

end)

end)

1 answer

For starters it's helpful if you have the whole section of code within a code block - rather than just one line.

Secondly, you'll need to detect what key has been pressed. More information about that can be found here

The line;

connect:game.Workspace.StarterGUI.CashierGUI.Enter(function()

is full of mistakes. The connect: comes after your 'declaration'. Also game.Workspace.StarterGUI would do absolutley nothing as the StarterGUI is not actually located within Workspace - It's located within game. So would just be game.StarterGUI.CashierGUI

I'd suggest trying some more basic scripting with some GUIs like changing the text of one with a script, and then work on KeyDown and once you've got both of them stick them together to form what you want.

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