Not A Valid Member When It Actually Is

This script keeps saying that Animate is not a valid member of Script when it is.

Annotation 2020-08-20 180340

It also doesn’t work if I change script.Parent to game.ServerScriptService

local animate = script.Parent.Morphing.KEKIMorph.Animate

5 Likes

Do you have any other things named morphing or KEKIMorph? If so, remove them and see if the error goes away. Also, game.ServerScriptStorage doesn’t exist, it needs to be game.ServerScriptService.

4 Likes

Where is your script located? From the line you’ve given it seems to be in ServerScriptService but just to make sure.

3 Likes

Yes it’s in server script service

1 Like

No I do not.

Yes, sorry I meant to write that.

1 Like

What is your error exactly? Could you please send a screenshot or something?

1 Like

have you tried doing:

local animate = script.Parent:WaitForChild("Morphing"):WaitForChild("KEKIMorph"):WaitForChild("Animate")
5 Likes

This likely isn’t the issue, but do you maybe have Archivable off for the localscript? If it is off it will not be part of the datamodel when you run the game.
@IFthenElse246’s solution might work, however I believe that the server has access to everything you have access to in studio that is archivable, meaning no need for WaitForChild().

1 Like

You only need to use WFC on the server for instances created at run-time, all instance made from studio will be available at run-time.

2 Likes

Local scripts can’t access ServerScriptService. I think even if it is in ServerScriptService

4 Likes

The real issue here is that you’re using LocalScripts server-side, they won’t even execute/ be compiled. If you’re meaning to clone a LocalScript yourself to the Client, then just leave it under Player.StarterPlayerScripts instead.

2 Likes

In
local animate = script.Parent.Morphing.KEKIMorph.Animate

What’s the script you’re referring to.

1 Like

From his structure I believe there’s different morphs with different animations, and he’s cloning them into the Character which would probably be the easiest solution, I believe this works completely fine.

1 Like

If your using this code on another script witch is parented to “KEKIMorph” then you can simply use

local animate = script.Parent.Animate
1 Like

May be add a WaitForChild for it to load?
Also which script are you editing now it would help.

Edit: LocalScripts don’t work on the `ServerScriptService.
Maybe that’s the problom?

2 Likes

Not sure you understood my post, I didn’t say the current structure wouldn’t work or refer to that at all.

To clarify even further, I’m saying that as an alternative to cloning local scripts to the player, you could leave your local scripts under StarterPlayerScripts and just alter the Disabled property, or use mutiple Events instead of this model; not that it’s necessarily better to.

Aside from that being already pointed out, we think the OP is meaning to clone them into the Character although that’s only an assumption without further posts from the OP.

he’s cloning them into the Character

2 Likes

having the same issue,

Controls is not a valid member of LocalScript workspace.1kbluefei.Tool.GUILocalScript