generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Re:alculator plugin.

Previous Thread :: Next Thread 
Flasket is not online. Flasket
Joined: 20 Jan 2011
Total Posts: 7639
13 Aug 2011 11:34 AM
(Missing a few functions, but this has the basic +, -, /, *, pi, sqrt)


base = PluginManager():CreatePlugin()
toolbar = base:CreateToolbar("MathTools")
button = toolbar:CreateButton("","Calculator tool","")
open = false
original = 0
second = 0
operator = 0
first = true
main = nil

button.Click:connect(function()
if not open then
open = true
main = Instance.new("ScreenGui",game.CoreGui.RobloxGui)
main.Name = "CalculatorMain"
local gui = Instance.new("Frame",main)
gui.Size = UDim2.new(0.300000012, 0, 0.400000006, 0)
gui.Position = UDim2.new(0.35, 0, 0.55, 0)
gui.BackgroundTransparency = .5
gui.BackgroundColor = BrickColor.new("Black")
gui.Name = "mainbg"
local gui2 = Instance.new("TextLabel",gui)
gui2.Size = UDim2.new(0.800000012, 0, 0.075000003, 0)
gui2.Position = UDim2.new(0.1,0,0.1,0)
gui2.BackgroundColor = BrickColor.new("Pastel light blue")
gui2.TextColor = BrickColor.new("Really black")
gui2.FontSize = "Size10"
gui2.Text = ""
gui2.Name = "display"
local gui3 = Instance.new("TextButton",gui)
gui3.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui3.Position = UDim2.new(0.5,0,0.3,0)
gui3.BackgroundColor = BrickColor.new("Medium stone gray")
gui3.TextColor = BrickColor.new("Really black")
gui3.FontSize = "Size18"
gui3.Text = "1"
gui3.Name = "one"
local gui4 = Instance.new("TextButton",gui)
gui4.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui4.Position = UDim2.new(0.625,0,0.3,0)
gui4.BackgroundColor = BrickColor.new("Medium stone gray")
gui4.TextColor = BrickColor.new("Really black")
gui4.FontSize = "Size18"
gui4.Text = "2"
gui4.Name = "two"
local gui5 = Instance.new("TextButton",gui)
gui5.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui5.Position = UDim2.new(0.75,0,0.3,0)
gui5.BackgroundColor = BrickColor.new("Medium stone gray")
gui5.TextColor = BrickColor.new("Really black")
gui5.FontSize = "Size18"
gui5.Text = "3"
gui5.Name = "three"
local gui6 = Instance.new("TextButton",gui)
gui6.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui6.Position = UDim2.new(0.5,0,0.45,0)
gui6.BackgroundColor = BrickColor.new("Medium stone gray")
gui6.TextColor = BrickColor.new("Really black")
gui6.FontSize = "Size18"
gui6.Text = "4"
gui6.Name = "four"
local gui7 = Instance.new("TextButton",gui)
gui7.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui7.Position = UDim2.new(0.625,0,0.45,0)
gui7.BackgroundColor = BrickColor.new("Medium stone gray")
gui7.TextColor = BrickColor.new("Really black")
gui7.FontSize = "Size18"
gui7.Text = "5"
gui7.Name = "five"
local gui8 = Instance.new("TextButton",gui)
gui8.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui8.Position = UDim2.new(0.75,0,0.45,0)
gui8.BackgroundColor = BrickColor.new("Medium stone gray")
gui8.TextColor = BrickColor.new("Really black")
gui8.FontSize = "Size18"
gui8.Text = "6"
gui8.Name = "six"
local gui9 = Instance.new("TextButton",gui)
gui9.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui9.Position = UDim2.new(0.5,0,0.6,0)
gui9.BackgroundColor = BrickColor.new("Medium stone gray")
gui9.TextColor = BrickColor.new("Really black")
gui9.FontSize = "Size18"
gui9.Text = "7"
gui9.Name = "seven"
local gui10 = Instance.new("TextButton",gui)
gui10.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui10.Position = UDim2.new(0.625,0,0.6,0)
gui10.BackgroundColor = BrickColor.new("Medium stone gray")
gui10.TextColor = BrickColor.new("Really black")
gui10.FontSize = "Size18"
gui10.Text = "8"
gui10.Name = "eight"
local gui11 = Instance.new("TextButton",gui)
gui11.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui11.Position = UDim2.new(0.75,0,0.6,0)
gui11.BackgroundColor = BrickColor.new("Medium stone gray")
gui11.TextColor = BrickColor.new("Really black")
gui11.FontSize = "Size18"
gui11.Text = "9"
gui11.Name = "nine"
local gui12 = Instance.new("TextButton",gui)
gui12.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui12.Position = UDim2.new(0.625,0,0.75,0)
gui12.BackgroundColor = BrickColor.new("Medium stone gray")
gui12.TextColor = BrickColor.new("Really black")
gui12.FontSize = "Size18"
gui12.Text = "0"
gui12.Name = "zero"
local gui13 = Instance.new("TextButton",gui)
gui13.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui13.Position = UDim2.new(0.375,0,0.3,0)
gui13.BackgroundColor = BrickColor.new("Medium stone gray")
gui13.TextColor = BrickColor.new("Really black")
gui13.FontSize = "Size14"
gui13.Text = "sqrt"
gui13.Name = "sqrt"
local gui14 = Instance.new("TextButton",gui)
gui14.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui14.Position = UDim2.new(0.5,0,0.75,0)
gui14.BackgroundColor = BrickColor.new("Medium stone gray")
gui14.TextColor = BrickColor.new("Really black")
gui14.FontSize = "Size18"
gui14.Text = "C"
gui14.Name = "clear"
local gui15 = Instance.new("TextButton",gui)
gui15.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui15.Position = UDim2.new(0.75,0,0.75,0)
gui15.BackgroundColor = BrickColor.new("Medium stone gray")
gui15.TextColor = BrickColor.new("Really black")
gui15.FontSize = "Size18"
gui15.Text = "="
gui15.Name = "equals"
local gui16 = Instance.new("TextButton",gui)
gui16.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui16.Position = UDim2.new(0.375,0,0.45,0)
gui16.BackgroundColor = BrickColor.new("Medium stone gray")
gui16.TextColor = BrickColor.new("Really black")
gui16.FontSize = "Size18"
gui16.Text = "+"
gui16.Name = "add"
local gui17 = Instance.new("TextButton",gui)
gui17.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui17.Position = UDim2.new(0.375,0,0.6,0)
gui17.BackgroundColor = BrickColor.new("Medium stone gray")
gui17.TextColor = BrickColor.new("Really black")
gui17.FontSize = "Size18"
gui17.Text = "-"
gui17.Name = "sub"
local gui18 = Instance.new("TextButton",gui)
gui18.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui18.Position = UDim2.new(0.375,0,0.75,0)
gui18.BackgroundColor = BrickColor.new("Medium stone gray")
gui18.TextColor = BrickColor.new("Really black")
gui18.FontSize = "Size18"
gui18.Text = "*"
gui18.Name = "mul"
local gui19 = Instance.new("TextButton",gui)
gui19.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui19.Position = UDim2.new(0.25,0,0.3,0)
gui19.BackgroundColor = BrickColor.new("Medium stone gray")
gui19.TextColor = BrickColor.new("Really black")
gui19.FontSize = "Size18"
gui19.Text = "/"
gui19.Name = "div"
local gui20 = Instance.new("TextButton",gui)
gui20.Size = UDim2.new(0.100000012, 0, 0.125, 0)
gui20.Position = UDim2.new(0.25,0,0.45,0)
gui20.BackgroundColor = BrickColor.new("Medium stone gray")
gui20.TextColor = BrickColor.new("Really black")
gui20.FontSize = "Size14"
gui20.Text = "Pi"
gui20.Name = "pi"

--Functions

gui3.MouseButton1Click:connect(function()
if gui2.Text == "0" then
gui2.Text = ""
end
if first then
original = original..1
gui2.Text = gui2.Text..gui3.Text
else
second = second..1
gui2.Text = gui2.Text..gui3.Text
end
end)
gui4.MouseButton1Click:connect(function()
if gui2.Text == "0" then
gui2.Text = ""
end
if first then
original = original..2
gui2.Text = gui2.Text..gui4.Text
else
second = second..2
gui2.Text = gui2.Text..gui4.Text
end
end)
gui5.MouseButton1Click:connect(function()
if gui2.Text == "0" then
gui2.Text = ""
end
if first then
original = original..3
gui2.Text = gui2.Text..gui5.Text
else
second = second..3
gui2.Text = gui2.Text..gui5.Text
end
end)
gui6.MouseButton1Click:connect(function()
if gui2.Text == "0" then
gui2.Text = ""
end
if first then
original = original..4
gui2.Text = gui2.Text..gui6.Text
else
second = second..4
gui2.Text = gui2.Text..gui6.Text
end
end)
gui7.MouseButton1Click:connect(function()
if gui2.Text == "0" then
gui2.Text = ""
end
if first then
original = original..5
gui2.Text = gui2.Text..gui7.Text
else
second = second..5
gui2.Text = gui2.Text..gui7.Text
end
end)
gui8.MouseButton1Click:connect(function()
if gui2.Text == "0" then
gui2.Text = ""
end
if first then
original = original..6
gui2.Text = gui2.Text..gui8.Text
else
second = second..6
gui2.Text = gui2.Text..gui8.Text
end
end)
gui9.MouseButton1Click:connect(function()
if gui2.Text == "0" then
gui2.Text = ""
end
if first then
original = original..7
gui2.Text = gui2.Text..gui9.Text
else
second = second..7
gui2.Text = gui2.Text..gui9.Text
end
end)
gui10.MouseButton1Click:connect(function()
if gui2.Text == "0" then
gui2.Text = ""
end
if first then
original = original..8
gui2.Text = gui2.Text..gui10.Text
else
second = second..8
gui2.Text = gui2.Text..gui10.Text
end
end)
gui11.MouseButton1Click:connect(function()
if gui2.Text == "0" then
gui2.Text = ""
end
if first then
original = original..9
gui2.Text = gui2.Text..gui11.Text
else
second = second..9
gui2.Text = gui2.Text..gui11.Text
end
end)
gui12.MouseButton1Click:connect(function()
if gui2.Text == 0 then
gui2.Text = ""
end
if first then
original = original..0
gui2.Text = gui2.Text..gui12.Text
else
second = second..0
gui2.Text = gui2.Text..gui12.Text
end
end)
gui13.MouseButton1Click:connect(function()
original = math.sqrt(original)
gui2.Text = original
end)
gui14.MouseButton1Click:connect(function()
original = 0
second = 0
gui2.Text = original
end)
gui15.MouseButton1Click:connect(function()
if operator == 0 then
original = original + second
elseif operator == 1 then
original = original - second
elseif operator == 2 then
original = original * second
elseif operator == 3 then
end
gui2.Text = original
end)
gui16.MouseButton1Click:connect(function()
operator = 0
second = 0
gui2.Text = second
first = false
end)
gui17.MouseButton1Click:connect(function()
operator = 1
second = 0
gui2.Text = second
first = false
end)
gui18.MouseButton1Click:connect(function()
operator = 2
second = 0
gui2.Text = second
first = false
end)
gui19.MouseButton1Click:connect(function()
operator = 3
second = 0
gui2.Text = second
first = false
end)
gui20.MouseButton1Click:connect(function()
original = math.pi
gui2.Text = original
end)
else
if main ~= nil then
print("Test")
open = false
main:Remove()
end
end
end)
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
13 Aug 2011 11:48 AM
Looks over-complicated. Still, seems like it could be useful at times.
Report Abuse
cymru72 is not online. cymru72
Joined: 26 Jan 2008
Total Posts: 4362
13 Aug 2011 11:50 AM
y u no loadstring le input

User input (e.g "math.sin(0.5)^2 / 5 + math.pi") > assign variable by loading le chunkehchunk > display / print output
Report Abuse
Danster5oo is not online. Danster5oo
Joined: 27 Aug 2010
Total Posts: 10003
13 Aug 2011 11:50 AM
What's two plus two?

print(2+2)

-The naked old man
Report Abuse
cymru72 is not online. cymru72
Joined: 26 Jan 2008
Total Posts: 4362
13 Aug 2011 11:51 AM
@dan,
5? I WIN, I WIN
Report Abuse
Danster5oo is not online. Danster5oo
Joined: 27 Aug 2010
Total Posts: 10003
13 Aug 2011 11:53 AM
My output says it's 4 :V

-The naked old man
Report Abuse
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
13 Aug 2011 12:07 PM
And this is why computer come with a calculator program. So you don't waste your time making these plugins.
Report Abuse
eXoguti093 is not online. eXoguti093
Joined: 17 Oct 2008
Total Posts: 1786
13 Aug 2011 12:09 PM
@Piedude777 I find it anoying opening the windows calculator when I need it, so I can't be the only one.
Report Abuse
AlphaBlock is not online. AlphaBlock
Joined: 02 Jan 2008
Total Posts: 599
13 Aug 2011 12:10 PM
make it play elmo's voice when you press a number
Report Abuse
coolSmillybob is not online. coolSmillybob
Joined: 29 Apr 2010
Total Posts: 575
13 Aug 2011 12:14 PM
@eXoguti093

Same here.
Report Abuse
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
13 Aug 2011 12:20 PM
I have a calculator button on my keyboard. I press it and a calculator pops up!
Report Abuse
Danster5oo is not online. Danster5oo
Joined: 27 Aug 2010
Total Posts: 10003
13 Aug 2011 12:33 PM
^

sh4r3 pl0x

-The naked old man
Report Abuse
Piedude777 is not online. Piedude777
Joined: 01 Oct 2008
Total Posts: 10017
13 Aug 2011 12:41 PM
It's built into my keyboard, old man.
Report Abuse
Danster5oo is not online. Danster5oo
Joined: 27 Aug 2010
Total Posts: 10003
13 Aug 2011 12:46 PM
WHAT? WHAT DID YOU SAY? I CAN'T HEAR YOU!

-The naked old man
Report Abuse
dekkonot is not online. dekkonot
Joined: 22 Dec 2010
Total Posts: 6685
13 Aug 2011 12:46 PM
^
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
13 Aug 2011 12:47 PM
ewwww, use button template
Report Abuse
Danster5oo is not online. Danster5oo
Joined: 27 Aug 2010
Total Posts: 10003
13 Aug 2011 12:48 PM
*grabs blocco arms*

SANDY? IS THAT YOU SANDY? IT'S BEEN THREE HUNDRED YEARS!

-The naked old man
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
13 Aug 2011 12:49 PM
I don't trust naked old men. Sorry.
Report Abuse
BrainScripter is not online. BrainScripter
Joined: 02 Aug 2011
Total Posts: 187
13 Aug 2011 12:49 PM
for i = 1, 9, 1 do
script.Parent["Button"..i]...blahblahblah
end


:P
Report Abuse
Danster5oo is not online. Danster5oo
Joined: 27 Aug 2010
Total Posts: 10003
13 Aug 2011 12:49 PM
YOU REMIND ME WHEN WE WALKED FORTY MILES TO GO TO SCHOOL.

-The naked old man
Report Abuse
Flasket is not online. Flasket
Joined: 20 Jan 2011
Total Posts: 7639
13 Aug 2011 12:50 PM
@brain

I thought about that.

But then I didn't.
Report Abuse
dmaster7 is not online. dmaster7
Joined: 16 Sep 2008
Total Posts: 1536
13 Aug 2011 12:56 PM
Steps to a successful calculator:

1) Make the Command Bar show up in Roblox Studio
2) Type "print(1+1)" or any math problem you have
3) Watch the Output bar for your answer
4) ?????
5) Profit
Report Abuse
Flasket is not online. Flasket
Joined: 20 Jan 2011
Total Posts: 7639
13 Aug 2011 12:58 PM
@dmaster

anddd? I still made a calculator.
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
13 Aug 2011 12:59 PM
YOUR CALCULATOR IS HORRIBLY INEFFICIENT

DO IT OVER
Report Abuse
BrainScripter is not online. BrainScripter
Joined: 02 Aug 2011
Total Posts: 187
13 Aug 2011 01:00 PM
@blocco: *points at siggy*

~How do you choice to express yourself? It's only tou and I can't tell, it comes naturally...mhm...it comes naturally.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image