Why is this an unknown require?

I’m getting an all too familiar W000 error on my tool script, that I simply don’t understand. As it seems to me, I’ve coded everything right and nothing should be wrong with the script, but obviously this is not the case.

When I try running the script, the output window fails to print("tool equipped"), so something’s definitely wrong here.

It would be a really big help if someone could help point out what I might have missed on my script, and what I can do to fix it.

1 Like

This is fairly odd. I’d try to do a studio restart to begin with, and hope that fixes it.

2 Likes

Restarted studio, still getting the same W000.
I think this is more complex than a simple visual glitch.

1 Like

make sure to check in explorer, say “frame”, but you accidentally wrote “Frame”. Check it over to make sure.

2 Likes

Isn’t require used to require module scripts? or Animator is a module script?
Correct me if im wrong

2 Likes

I think it is because the PlayerGui doesn’t exist until the actual player exists. Use :WaitForChild or something like that.

local PlayerGui = Player:WaitForChild("PlayerGui")
2 Likes

Also make sure in module script you did like this:

this at start of module script:

local module = {}

this at end of module script:

return module
1 Like

Try re-making the script, will the error still persist? Also paste your code with the screenshot so we can test it for ourselves to see if it can be reproduced.

1 Like

Your solution silenced the warning, but now capacity is “not a valid member of PlayerGui” according to the output window, despite explorer showing otherwise.

2020-07-07 (4)

However when I remove the local animator line entirely, the script works just fine.

There’s nothing wrong with the module script. I’m using TweenSequence plugin, which uses working module scripts. The script I made is only trying to communicate with it.

Scripts usually run so fast that, in your case, it hasn’t cloned “capacity” into the PlayerGui yet when the game runs. I think you’ll have to use ANOTHER :WaitForChild to get that.

If doing that gives the Infinite yield warning, use the second parameter of :WaitForChild so it waits that time in second

2 Likes