Epix-Incorporated/Adonis

"[Adonis] script:3: attempt to index nil with 'Scripts'" on a :starter(client)script after rejoin

Closed this issue · 1 comments

Version channel

Stable (Default)

Loader version

249

What part of Adonis is this related to?

Command

What happened?

When rejoining after having added a script using :starterscript or :starterplayerscript, the script will output the error [Adonis] script:3: attempt to index nil with 'Scripts' no matter the code you input in the command.

I believe it is due to Line 3 in LocalScriptBase.client.lua executing before Adonis has finished loading on the client.

A simple fix would be replacing the task.wait() at the start of the script with a

while rawget(_G, "Adonis") == nil do
	task.wait()
end

Device

Windows

Relevant log output

No response

PR #1516 should fix it!