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 » Scripting Helpers
Home Search
 

Re: Calculator

Previous Thread :: Next Thread 
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
14 Sep 2011 07:04 PM
This is the main script i have all the values handles but.. it only checks multiplcation ex:
i sellect addition (AboolValue) and i set main number (1337) and secondary number (145) it should print (Or create a message i cant decide) you check what you want multiplcation, division, additon, subtraction so when it checks it says + (Because im adding) in the StringValue, but it only works if you check multiplcation

what im sating is that it only checks one then ends or whatever
if is spelled something wrokg, deal with it

mn = script.Parent.MainNumber.Value
sn = script.Parent.SecondaryNumber.Value
mul = script.Parent.Multiplcation.Value
div = script.Parent.Division.Value
add = script.Parent.Addition
sub = script.Parent.Subtraction
sp = script.Parent
sym = script.Parent.Symbol

if mul == true then
sym.Value = "*"
print 'Multiply'
else
if div == true then
sym.Value = "/"
print 'Division'
else
if add == true then
sym.Value = "+"
print 'Addition'
else
if sub.Value == true then
sym.Value = "-"
print 'Subtraction'

end end end end
Report Abuse
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
14 Sep 2011 07:07 PM
tl;dr
Report Abuse
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
14 Sep 2011 07:25 PM
Bumb i know there is someone out there to help
Report Abuse
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
14 Sep 2011 07:34 PM
still dosent work but i think this is better

mn = script.Parent.MainNumber
sn = script.Parent.SecondaryNumber
mul = script.Parent.Multiplcation
div = script.Parent.Division
add = script.Parent.Addition
sub = script.Parent.Subtraction
sp = script.Parent
sym = script.Parent.Symbol

if mul == true then
sym.Value = "*"
print 'Multiply'
end
if div == true then
sym.Value = "/"
print 'Division'
end
if add == true then
sym.Value = "+"
print 'Addition'
end
if sub.Value == true then
sym.Value = "-"
print 'Subtraction'
end
Report Abuse
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
14 Sep 2011 07:55 PM
Ok im the only one postin
asdgfasfv5343572349upguhdsaf-4u5h3245624368y23-95hn23perasdnfka[se]r345u2=-369u2346j2430-e8riewqjfdsa
Report Abuse
Rukiryo is not online. Rukiryo
Joined: 04 Sep 2009
Total Posts: 1490
14 Sep 2011 07:56 PM
You said
if mul == true then
I'm assuming mul is a boolvalue, and you must say
mul.Value == true
in that case.
Report Abuse
Rukiryo is not online. Rukiryo
Joined: 04 Sep 2009
Total Posts: 1490
14 Sep 2011 07:57 PM
In fact, you have multiple ones where you said
if mul == true, or div == true. Check that. It must be a value.
Report Abuse
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
14 Sep 2011 08:01 PM
So no if?
Report Abuse
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
14 Sep 2011 08:04 PM
Wait there has to be a if
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
14 Sep 2011 08:06 PM
mn = script.Parent.MainNumber.Value
sn = script.Parent.SecondaryNumber.Value
mul = script.Parent.Multiplcation
div = script.Parent.Division
add = script.Parent.Addition
sub = script.Parent.Subtraction
sp = script.Parent
sym = script.Parent.Symbol

if mul.Value == true then
sym.Value = "*"
print 'Multiply'
else
if div.Value == true then
sym.Value = "/"
print 'Division'
else
if add.Value == true then
sym.Value = "+"
print 'Addition'
else
if sub.Value == true then
sym.Value = "-"
print 'Subtraction'

end end end end


-Like an __AWESOME__ boss
Report Abuse
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
14 Sep 2011 08:09 PM
Workspace.Calculator.Calculator:30: NO!

mn = script.Parent.MainNumber.Value
sn = script.Parent.SecondaryNumber.Value
mul = script.Parent.Multiplcation
div = script.Parent.Division
add = script.Parent.Addition
sub = script.Parent.Subtraction
sp = script.Parent
sym = script.Parent.Symbol

if mul.Value == true then
sym.Value = "*"
print 'Multiply'
else
if div.Value == true then
sym.Value = "/"
print 'Division'
else
if add.Value == true then
sym.Value = "+"
print 'Addition'
else
if sub.Value == true then
sym.Value = "-"
print 'Subtraction'

end end end end

if
sym.Value == "" then
error'NO!'
end
Report Abuse
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
14 Sep 2011 08:09 PM
Workspace.Calculator.Calculator:30: NO!

mn = script.Parent.MainNumber.Value
sn = script.Parent.SecondaryNumber.Value
mul = script.Parent.Multiplcation
div = script.Parent.Division
add = script.Parent.Addition
sub = script.Parent.Subtraction
sp = script.Parent
sym = script.Parent.Symbol

if mul.Value == true then
sym.Value = "*"
print 'Multiply'
else
if div.Value == true then
sym.Value = "/"
print 'Division'
else
if add.Value == true then
sym.Value = "+"
print 'Addition'
else
if sub.Value == true then
sym.Value = "-"
print 'Subtraction'

end end end end

if
sym.Value == "" then
error'NO!'
end
Report Abuse
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
14 Sep 2011 08:10 PM
Sorry double post lag
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
14 Sep 2011 08:10 PM
Obviously, none of the values are true.


-Like an __AWESOME__ boss
Report Abuse
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
14 Sep 2011 08:12 PM
NO DUR!
Report Abuse
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
14 Sep 2011 08:13 PM
Sorry just really want this script
Report Abuse
GoldenUrg is not online. GoldenUrg
Joined: 23 Aug 2009
Total Posts: 6428
14 Sep 2011 09:21 PM
If you use "elseif" instead of "else if" then you don't need an extra end.

Why don't you also print each object's value to make sure they are what you expect?
Report Abuse
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
15 Sep 2011 04:59 PM
You are a god. Thx
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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