"Not a valid member" Situation

I’ve been at it for a few hours now and I need some help.

I’m trying to test out a function where the LocalScript fires a command to play a sound under the same hierarchy and is supposedly doing what it’s programmed to do… in studio mode.

image

  1. The script firing the command
  2. The sound playing in the ‘DialogBox’ parent

I tried testing it in a real server. Everything works perfectly fine the script runs the way it should (both in studio and on a dedicated server) until the ‘play sound’ code is fired. I keep getting this error message and it’s starting to get a little ridiculous.

image

I just want to know why this is happening and what I can do to to overcome this error. Thanks!\

[EDIT] Right I forgot the actual stuff ya’ll need, although it’s pretty predictable and self-explanatory (I’m no pro scripter just FYI)

8 Likes

Please post your code. Most likely you are calling “Confirm” before it is actually loaded, but I wouldn’t know without seeing code.

3 Likes

This or he’s doing something like
script.Parent.Confirm = 2343734

where he’s forgetting one step to the hierarchy

2 Likes

maybe try and switch from localScript to normal script class

1 Like

I’ve spent hours trying to figure out what’s wrong, and do this. Usually with Value Objects, forgetting to call script.Parent.Name.Value

1 Like

No, a LocalScript is the more appropriate of the two for GUIs. Interface is clientside.

12 Likes

nOOOOOOOOOOOOOOOOOOOOOO

14 Likes

Have you used WaitForChild on the Confirm object?
Are you sure you’re accessing the right thing?

Can we please see the code?
This error is related to scripting logic so we can only solve this if we can see exactly what that part of the script is.

2 Likes
local Confirm = script.Parent:WaitForChild("Confirm")
Confirm:Play()

Didn’t mean to reply to you.

6 Likes

What @vsnry wrote is what you’re looking for. Just remember Play is a function, so it should be Confirm:Play()

Could you post your code just so we can further see why it was resulting in an error?

2 Likes