English What this error means?

3 replies
Goto Page
To the start Previous 1 Next To the start
25.04.20 09:49:33 am
Up
SuperKHALED
User
Offline Off
This error is keep showing but the script is running fine
so what it means?

IMG:https://i.ibb.co/xgjkwct/Untitled.png

IMG:https://i.ibb.co/9WyDTD0/Untitled2.png


and this one

IMG:https://i.ibb.co/bF0FPvw/Untitled3.png

IMG:https://i.ibb.co/smS7yrY/Untitled4.png
the best
25.04.20 11:37:54 am
Up
DC
Admin
Offline Off
You probably never assigned any value to
moneyz[id]
(with the id value which is currently used at that point)

Therefore it is nil (does not exist / has no value). You can't compare nil and you can't add something to nil. That's what the errors mean.

You have to initialize the value first by doing
moneyz[id] = YOUR INITIAL VALUE
e.g.
moneyz[id] = 0


And you have to do that for all possible id values (probably 1-32 if those are player IDs). This must happen in the beginning. BEFORE you try to access these values.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
25.04.20 02:08:51 pm
Up
Cure Pikachu
User
Offline Off
Right. Make sure your script has something like this:
Code:
1
2
3
4
5
6
7
8
9
10
11
moneyz = {}

addhook("join","initvalue")
function initvalue(id)
     moneyz[id] = 0
end

addhook("leave","resetvalue")
function resetvalue(id)
     moneyz[id] = nil
end
IMG:https://i.imgur.com/uUrye71.png
IMG:https://i.imgur.com/xpsyQRX.png
28.04.20 12:19:21 am
Up
script favor
User
Offline Off
You're attempting to compare a value with nil value like
Code:
1
1 > n
, but we don't know what n is , in other words n is not defined
To the start Previous 1 Next To the start