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

"Instance" is not a valid member of "model", altough I can clearly see it is?

Asked by 3 years ago

So, I'm trying to use the Trello API. I'm intending to set a variable which will check for a list on a trello. Problem is, when I try to set the name of that list (would be medalselectorframe.Medal[i]), it returns an error saying: Medal is not a valid member of ScrollingFrame.

remotefunction.OnServerInvoke = function(player)
    print(player)
    local medalselectorframe = player.PlayerGui.Form.form.MedalSelector
    for i = 1,14,1 do -- Change for number of medals, accordingly.
    if medalselectorframe.Medal.Style == Enum.ButtonStyle.RobloxRoundDefaultButton then -- checks ownership if selected
        local medalListID = API:GetListID(medalselectorframe.Medal[i].Text,requestBoardID) -- This is important! Buttons need to be named EXACTLY like the trello boards for a medal.
            local ownerCards = API:GetCardsInList(medalListID) 
            if string.find(ownerCards.player) then
                print("Medal is owned.")
            else
                warn("Medal is NOT owned. Can't proceed.")
            end
        end
    end
end
0
It's likely because you're trying to access a descendant of the PlayerGui through the server. DeceptiveCaster 3761 — 3y
0
maybe WaitForChild? If the Instance doesn't exist at the time of the script running then this could solve your issue FlabbyBoiii 81 — 3y
0
unless you're running through a server-script, in which case I think DeceptiveCaster may be correct FlabbyBoiii 81 — 3y
0
Yeah, that might be it. I'm using a server script. Javgarag 2 — 3y

Answer this question