Hi! I'm new to the forums, but I love CBLite and look forward to collaborating with you guys!

Well, I've done some programming before, but never in real basic... but I've figured out some code, but for some reason I get errors, and I was hoping that someone could help me figure this out, so here we go:
Dim roll As ArrayClass
Dim ac, modifiedRoll, crit, hit, critMiss, numDice As Double
Dim i As Integer
Dim output As String
'So here I'm trying to take three input parameters to determine how many dice to roll,
'then through control statements determine if it is a hit or miss.
roll = New ArrayClass
output = ""
numDice = RollDice(GetScriptParameter("param1"))
hit = RollDice(GetScriptParameter("param2"))
crit = 97
critMiss = 3
ac = RollDice(GetScriptParameter("param3"))
'Dice are rolled here
For i = 0 To (numDice -1)
roll.Append(RollDice("1d100"))
Next
For i = 0 To numDice
modifiedRoll = roll.Items(i) - ac
If modifiedRoll >= hit and roll.Items(i) < crit Then
output = output + Str(modifiedRoll) + " - " + "Hit!" + EndOfLine
ElseIf roll.Items(i) >= crit Then
output = output + Str(modifiedRoll) + " - " + "Critical Hit!" + EndOfLine
ElseIf roll.Items(i) <= critMiss Then
output = output + Str(modifiedRoll) + " - " + "Critical Miss!" + EndOfLine
Else
output = output + Str(modifiedRoll) + " - " + "Miss!" + EndOfLine
End If
Next
ReturnValue(output)
But for some reason, it throws up all over my ArrayClass. Anybody have any suggestions?