#i require assistance please

1 messages · Page 1 of 1 (latest)

empty venture
#

in these images, one shows the fact that im trying to make it where when a new prompt gets created it destroys the old one immediately (to prevent stacking.), but i keep getting this error in the other image, and i have no idea how to get around this since im handling the gui in a modulescript.

hazy moss
worldly lark
hazy moss
#
if not gui or not gui.Parent then return end
empty venture
#

ive added it

#

and when i walk away it puts "test" aswell (i removed it before sending that img)

hazy moss
empty venture
#

if not gui or not gui.Parent then return end

hazy moss
#

I mean here

empty venture
#

ohhhhh

#

now ive added it

#

wait

#

do u want me to replace gui:Destroy?

hazy moss
#

no

empty venture
#

oh

hazy moss
#

i'll explain

empty venture
#

ok

hazy moss
#

This is your error. It means that its trying to call the Destroy method on a variable which does not have that method.

empty venture
#

yes

hazy moss
#

The reason for why it does not have that method is probably because the gui doesn't exist anymore because it already got destroyed

empty venture
#

oh yeah

#

to be fair

#

when i loaded in

#

and i looked in player gui, i noticed one immediately get removed

#

but then a new one got added

#

right afterwards

hazy moss
#

strange but you can avoid the error by just checking if the gui exists

empty venture
#

then adding gui:Destroy???

#

after it?

#

like inside the if statement?

hazy moss
#

which you do by checking if the gui == nil or the parent of the gui == nil. And the simplified version of that would be:

if not gui or not gui.Parent then return end

its the same as:

if gui == nil or gui.Parent == nil then return end
empty venture
#

yeah i know

#

but im confused, if it prints test if the gui doesnt exist, then what else is there to do?

#

thats me going away from it

#

my main point is that i want to make it stop stacking

#

like all the guis

hazy moss
#

can i see where you create the gui

empty venture
hazy moss
empty venture
#

nonono

#

i have it where if the proximity prompt has like itemdetailprompt for the attribut ethen it creates the ui for it

hazy moss
#

ah its not about npcs anymore

empty venture
#

no

#

im now working on proximity prompts

#

then ill get to dialog prompts

#

or later on maybe

#

ive been working on this 4 ages but i barely work on it

#

like here and there

hazy moss
empty venture
hazy moss
#

aaa

empty venture
#

yes

hazy moss
#

function module.onhidden(instance, prompt, InputType, gui)
    if currentprompt then
        if gui and gui.Parent then
            gui:Destroy()
            currentPrompt = nil
        end
    end
end

Should do it tho.

empty venture
#

what about doing this

#

then changing it in onhiddne

empty venture
hazy moss
empty venture
#

i just realised that aswell..

#

should i try make it where if theres another gui duplicated it removes the old one in createpromptforattribute?

hazy moss
#

well i think the best thing to do is just to not even create a new gui if there already is one.

#

Feels alot cleaner

empty venture
#

how do i do that

#

i think using values can do but i dont want to do that,i feel like theres a simpler way

hazy moss
#

can i see your function that creates the itemdetailprompt

empty venture
hazy moss
# empty venture

Make a function to detect if a itemdetailprompt already exists that has its adornee set to the prompts parent.

#

Just loop through each itemdetailprompt and check if the adornee is the same as the parent of the prompt variable given inside the function.

empty venture
#

icl this is so long

#

idek if i can be bothered

#

genuinely

hazy moss
#

huh its just a for loop and returning true if the condition is met

empty venture
#

no but like ive been trying for hours now

#

its lowkey draining me

#

nothing works

#

ill do this later

#

i give up with this shit

#

atm

hazy moss
#

fair enough. Breaks are needed

#

Ping me once if you got it to working or if there is another issue.

empty venture
#

in the createprompt function?

#

omg

#

nevermind

#

i got it to work

#

all i had to add was only gui in the function

#

wait nvm

#

the thing is, when i put gui it showed ProximityPrompt instead of BillBoard gui

#

which i suppose thats what i want it to say

hazy moss
#

bruh

#

well at least it works now 👍

empty venture
#

no it doesnt

slow deltaBOT
#

studio** You are now Level 10! **studio