#getting vaule

1 messages · Page 1 of 1 (latest)

ripe sierra
#

okay im trying to make it where if you click a text but and the vaule is not at 1 it wont work

ripe sierra
#

i fixed it but now i need help im trying to make qustions but my q2 is now gonna change the the button when im dooing the q1 my things is liek this if q1 it pressed then change q1 and q2 and q3 to the ones like 1_q1_q2_2 its like this but can i make it where my q2 dosent pcik up when its all ready in like the q1 qustions do i need to do a number vuale

shut wasp
#

please.

#

use punctuation

#

i beg

#

. , and :

#

please use those

soft sigil
#

Yeah...

fiery basinBOT
#

studio** You are now Level 1! **studio

soft sigil
#

From the very little I can understand after reading this a couple times, it doesn't seem like it'd be too hard a problem to solve if it was comprehensible

ripe sierra
#

i did it just one problem im trying to make it where if Q = nil then it will be able to change to 1 and if not it wont be able too

shut wasp
#

just send the script

ripe sierra
#

The only thing that’s doing problems is

fiery basinBOT
#

studio** You are now Level 2! **studio

ripe sierra
#

If Q or Q ~= nil
Then
Q = 1

#

End

#

It changes even when it’s not nil

soft sigil
#

This has just brought me more confusion

#

So you have something like:

if Q or Q ~= nil then
  Q = 1
end

?

slow kayak
ripe sierra
soft sigil
#

Could you provide a snippet of the code to further clarify

shut wasp
#

no send FULL code

ripe sierra
#

one sec

soft sigil
ripe sierra
#

q1.MouseButton1Click:Connect(function()
if not Q or Q ~= nil then
Q = 1
end
if not screenGui.Enabled then
return
end

if textsValue and textsValue.Value then 
    local currentDialogNum = dialogNum or tonumber(textsValue.Value)
    local followupKeyq1 = tostring(currentDialogNum) .. "_q1followup_" .. tostring(followupIndex) .. "_" .. tostring(Q)
    print("Button pressed. followupIndex:", followupIndex, "dialogNum:", currentDialogNum, "followupKey:", followupKeyq1,"q:", Q)
    if textrandom[followupKeyq1] then
        local followup = textrandom[followupKeyq1]
        local displayName = player and player.DisplayName or "Player"
        local finalText = string.gsub(followup, "%[player%.display%.name%]", displayName)
        textLabel.Text = finalText
        followupIndex = followupIndex + 1
        print("Displayed follow-up text:", finalText)
        print(Q)

    end
        
    
end

end)

shut wasp
#

"if not Q"

#

that just means if Q is false

ripe sierra
#

Okay how do I make it only change it when it is nil

soft sigil
#
if Q == nil then
  Q = 1
end

??

#

or

#
if not Q then
  Q = 1
end
shut wasp
#

Oh also

#

why should it be nil when you can just make it 0

#

and why set it to 1 if you want it to increase

#

just do

if Q = 0 then
    Q += 1
end
#

oh wrote it wrong

#

Q == 0