#buttons don't show up help pls

1 messages · Page 1 of 1 (latest)

surreal hornet
#

ive been making a card game and the buttons dont want to show up they stay invisible and its printing the card art with the id but nothing shows up in the id property?? here is my code: theres other scripts as well which might be interfering:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CardArtDB = require(ReplicatedStorage:WaitForChild("CardArtDB"))
local player = game.Players.LocalPlayer
local gui = player:WaitForChild("PlayerGui"):WaitForChild("DecklockUI")

local cardFrames = {
    gui:WaitForChild("Card1"),
    gui:WaitForChild("Card2"),
    gui:WaitForChild("Card3")
}

local function updateHand()
    local hand = player:WaitForChild("Hand")

    local cards = {}
    for _, card in ipairs(hand:GetChildren()) do
        table.insert(cards, card)
    end

    table.sort(cards, function(a, b)
        return a.Name < b.Name
    end)

    for i = 1, 3 do
        local frame = cardFrames[i]
        local card = cards[i]

        if card then
            local art = CardArtDB[card.Value]
            print("Art for card:", art) 
            if art then
                frame.Image = art
                frame.Visible = true
                frame.ImageTransparency = 0
            else
                frame.Visible = false
            end
        else
            frame.Visible = false
        end
    end
end

player:WaitForChild("Hand").ChildAdded:Connect(updateHand)
player:WaitForChild("Hand").ChildRemoved:Connect(updateHand)

wait(1) 
updateHand()
formal helm
# surreal hornet

Possibly cause the image needs in format, i dont really see the ids in the code?

#

if the id is just "71627181817" it wont work.

surreal hornet
surreal hornet
formal helm
#

i think thats the format

surreal hornet
#

yep

formal helm
#

huh

#

have you debugged it yet?

surreal hornet
#

I've been on this for like a week now

surreal hornet
surreal hornet
formal helm
#

huh

#

i dont know on why that wouldnt work im probably just high asf since im on phone at 2 30 in the morning

surreal hornet
#

I'm crashing out

dull drum
#

Yo

pliant arrow
#

is th

#

this

#

@surreal hornet

surreal hornet
#

?

pliant arrow
#

is this the thrae

#

d

#

u eed help

surreal hornet
#

yes

pliant arrow
#

UwU

surreal hornet
#

i just got blinded by your profile

pliant arrow
#

MY SOP ACEA R E BORKEN

#

REALLY

#

Hold on

#

imma ana ly se now

surreal hornet
#

i can see why it got automodded

pliant arrow
#

helo

#

did u forgot to change te parent of the card

#

or it's normal

surreal hornet
#

no

pliant arrow
#

hold on

#

What is supposed to be the hand's childrem?

#

Just curious

surreal hornet
pliant arrow
#

oo i see

#

Can u ss the button's position

#

i see it's not in a frame but straight inside of screengui

#

:C

#

sorri if im wron

#

g

surreal hornet
#

you think that's the case?

pliant arrow
#

yea

#

i don see the ui

surreal hornet
#

alright let me see

pliant arrow
#

Wait

#

ur selecting the button s in startergui

#

try to select in playergui

surreal hornet
#

alright

#

position and size are empty?

pliant arrow
#

I thinK tjay's the point

#

Hold on

#

You should try to make button template

#

and clones whenever something is added to player's hand