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

Cannot find gui?

Asked by 10 years ago

I have made a script in a gui and for some reason it keeps having an error saying "MoneyGUI is not a valid member of PlayerGui"

Here is the script :

local player = script.Parent.Parent.Parent
local startergui = player.PlayerGui
local moneyv = startergui.MoneyGUI.MoneyV
local frame = script.Parent.Frame
local image1,image2,image3,image4,image5 = frame.Image_1,frame.Image_2,frame.Image_3,frame.Image_4,frame.Image_5
local nem = script.Parent.Nem

image1.MouseButton1Down:connect(function()
    if moneyv.Value <= image1.Pay.Value then
        moneyv.Value = moneyv.Value-image1.Pay.Value
    else
        nem.Visible = true
        wait(2)
        nem.Visible = false
    end
end)

1 answer

Log in to vote
2
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
10 years ago

It might be called MoneyGui, it might be spelled incorrectly, it might not have loaded yet, what kind of answer are you looking for? Do you not understand the output? The output means it isn't there. Are you asking why the output is giving that response? There is not enough information to determine the correct relevant answer.

In the specific possible case that it hasn't loaded yet, use startergui:WaitForChild("MoneyGUI").MoneyV instead.

0
Thank you very much, the spelling wasn't the problem it was probably because it didn't load. ROBLOXING213 130 — 10y
Ad

Answer this question