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

Why is this happening?

Asked by 9 years ago

I have a localscript that sets a value inside a Frame to "true." The localscript is inside a tool. Here's the code:

function unSelected(mouse)
    game.Players.LocalPlayer.PlayerGui.bow.Frame.Value.Value = true
end

script.Parent.Unequipped:connect(unSelected)

The problem is that the output always reads "Value is not a valid member of Frame," even if Value isn't nil. Putting something like this:

value = game.Players.LocalPlayer.PlayerGui.bow.Frame:WaitForChild("Value")
function unSelected(mouse)
    game.Players.LocalPlayer.PlayerGui.bow.Frame.Value.Value = true
end

script.Parent.Unequipped:connect(unSelected)

doesn't have any output, but the script does nothing at all. It doesn't change the value. Can anybody explain why this is happening?

1 answer

Log in to vote
0
Answered by 9 years ago

It's waiting for something that doesn't exist.

0
You don't know what :WaitForChild() means, do you? whyOmustOitObeOme 7 — 9y
Ad

Answer this question