|
| 29 May 2013 11:42 AM |
So, I started scripting today, I've been messing with around with some scripts for quite a while now. But I have a problem. So I made this pointless little script to practise, but it doesent really work. It is supposed to solve two equasions and then either say: "The result from both equasions is " ..result1. Or "The result of equasion 1 is " ..result1 " and the result of equasion 2 is " ..result2.
Here's the full script:
Number1 = 21 Number2 = 10 Number3 = 30 Number4 = 20 Result1 = Number1 - Number2 Result2 = Number3 - Number4
if Result1 == Result2 then Workspace.Message.Text = "The results are both " ..Result1 wait(2) Workspace.Message.Text = "" else Workspace.Message.Text = "The result of equation 1 is: " ..Result1 "The result of equation 2 is: " ..Result2 wait(2) Workspace.Message.Text = "" end
So here's the error message:
18:35:53.805 - Workspace.Script:17: attempt to call global 'Result1' (a number value) 18:35:53.806 - Script "Workspace.Script", Line 17 18:35:53.806 - stack end
I just dont know what's wrong with Result1. Is it because in the upper part I write
Workspace.Message.Text = "The results are both " ..Result1?
Please help me if you can.
|
|
|
| Report Abuse |
|
|
| 29 May 2013 11:44 AM |
This line: Workspace.Message.Text = "The result of equation 1 is: " ..Result1 "The result of equation 2 is: " ..Result2
Should be:
Workspace.Message.Text = "The result of equation 1 is: " ..Result1.. "The result of equation 2 is: " ..Result2
You forgot a '..' after Result1 |
|
|
| Report Abuse |
|
| |