Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

any help ServerScriptService.Main.Mob:4: attempt to index nil with 'Move' ?

Asked by 2 years ago

please i need more help

0
Whats the script Puppynniko 1059 — 2y
0
I can't answer this question. Give the script so I can fix it. Please include more information in your question. GamerLighting23233 63 — 2y

1 answer

Log in to vote
1
Answered by 2 years ago

usually when there's an error like attempt to index nil with ... is because it hasn't loaded in yet

you could try to use :WaitForChild(instancename, timeout) which returns the instance after it has loaded.

the parameter instance name as it implies, takes in the child name.

the parameter timeout is the time in seconds before it stops waiting until the child loads.

in your case it could be something along the lines of

local serverscriptservice = game:GetService("ServerScriptService")
local main = serverscriptservice:WaitForChild("Main")
local mob = main:WaitForChild("Mob")

now you can index the Mob instance with move without problem.

if you prefer not to use variables you could also just simply do

game:GetService("ServerScriptService"):WaitForChild("Main"):WaitForChild("Mob")

then again. this is just based off of the little information you have given to me.

if this doesn't help then please do include some code so people get better context of why exactly you're facing a problem.

Ad

Answer this question