#error: attempt to index nil with 'CharacterName'

65 messages · Page 1 of 1 (latest)

tiny shell
#

i am making battlegrounds game, and have this error, idk why ist error there
1:local script
2:module script

#

local script

#

error in line 64

#

Module script

#

help somebody

#

idk whats worng (

tiny shell
#

wait

worn geyser
#

oh'

#

the title

#

nvm

#

1 sec

tiny shell
#

attempt to index nil with 'CharacterName'

worn geyser
#

whats charactername

#

is it a variable you have

tiny shell
#

no

#

value

worn geyser
#

oh in line 64

#

i see

#

where do you have the local script and module script

tiny shell
#

local script in StarterCharacterScripts

wind baneBOT
#

studio** You are now Level 1! **studio

tiny shell
#

module in REplicatedStorage

worn geyser
#

you used require(<modulescriptlocation>) to get the module script too right? (characterdata)

tiny shell
#

yes

worn geyser
#

dont really get the issue here

tiny shell
#

me too

worn geyser
#

sorry you're gonna have to wait for someone else

tiny shell
#

k

#

😦

worn geyser
tiny shell
#

yes

worn geyser
#

no

#

checking if CharacterName is nil

tiny shell
#

oh

#

wait

#

oh no

#

il said wrong

#

character name isnt value

#

its in MOdule script

worn geyser
#

its a string

#

i can see

#

shouldnt characterdata be

#

the module script location

#

if you havent dont that already

tiny shell
#

not yet

#

by the way on other script there is no errors

#

only at that

#

hey

#

i fixed it

#

but have another error

#

in line 65

wind baneBOT
#

studio** You are now Level 2! **studio

tiny shell
#

like

#

attempt to index nil with 'Attacks'

#

attacks is frame in mainGui

silver bobcat
#

Show your server-sided code

#

That's what's at fault; it's not giving the client what it's expecting

tiny shell
#

what?

silver bobcat
# tiny shell what?

The error, "Attempt to index nil with X", is raised when the following occurs: nil.Member. In other words, you're writing:

EquippedCharacterName = nil.CharacterName

I'm sure you can understand why this would raise an error. The error is informing you that "CharacterData" is nil, and "CharacterData" is a piece of data you receive from the server

#

Ergo your server code is faulty

tiny shell
#

oh

#

ty

tiny shell
#

BRUH