#What is this error message

1 messages · Page 1 of 1 (latest)

odd thorn
#

what does this mean, i tried to add 1 to an intvalue (specifically a leaderstat) and this msg showed up

surreal shell
#

show the script

agile pagoda
#

this means

#

that it tried to add nil and number

#

this means that your leaderstat is nil

odd thorn
#

uh

#

wait a sec

#

there

#

i asked ai once and it failed horribly and i didnt remove the indicators

agile pagoda
#

the error is on line 35 right?

odd thorn
#

yes

surreal shell
#

cash.value

odd thorn
#

the part where i try to add to cash

agile pagoda
#

do you know anything about scripting or are you just blindly asking ai

odd thorn
agile pagoda
#

so

#

the method FindFirstChild tries to find an instance and returns nil if it doesn't

odd thorn
#

cash.Value sends an error msg that "tried to define value with nil" or smth

agile pagoda
#

the error is saying that you are trying to add nil and a number

odd thorn
#

oh

agile pagoda
#

so cash is nil

surreal shell
#

also that

agile pagoda
#

so leaderstats doesn't have a child named cash

odd thorn
#

ah

#

i see

#

lemme try something

#

what is this

agile pagoda
#

you are trying to add a value instance to a number

odd thorn
#

well ik what it is

agile pagoda
#

like IntValue or NumberValue

#

you have to add to cash.Value

odd thorn
#

so

#

Punches.Value?

agile pagoda
#

because cash is an object and not a number

#

yeah

odd thorn
#

yey it works

#

man i am never asking ai again

odd thorn
# agile pagoda because `cash` is an object and not a number

uh sorry to bother you but uh im running into a problem where (im supposing you could tell this is an m1 script) when i punch a player it instantly kills them when they get up sometimes (it doesnt always happen). can you tell what's wrong?

#

these are my ragdoll scripts

agile pagoda
#

it's likely something to do with the fact that if you disconnect a humanoid's head it dies

#

probably because the ragdoll changes the joints

odd thorn
#

ohh

agile pagoda
#

but i have no idea how to fix that

odd thorn
#

but why might it only happen on occasion and not every time

agile pagoda