#whenever i sell i want it to say like "here you go 2323$" - example value

1 messages · Page 1 of 1 (latest)

tulip wolf
#

erm why does it not let me send it

#

can someone dm me and hlep me

#

its only 65 lines

#

sorry it wont let me send the actually script

opal tree
# tulip wolf

The string and getting total seems to be fine. You aren't getting any actual errors?

#

If you aren't then the issue may be further in your system, and you should add a lot of temporary print() to locate the issue.

tulip wolf
#

no

#

but it shows the "text"

#

not the value or wtv

#

@opal tree

opal tree
#

So the script works it's just the text not properly displaying? Can you show me what it is showing on the textlabel?

tulip wolf
#

yes

opal tree
#

I am guessing this isn't your system.. This is overriding the message you are trying to send

tulip wolf
#

😭

#

its just when i tried to make it as " " or rewrite or overwrite i should say it doesnt work

opal tree
#

try that instead

#

I've had issues with rich text due to not formatting string maybe for some reason it is the same for your system

tulip wolf
#

like this right?

#

@opal tree

#

if so it didnt work

opal tree
tulip wolf
#

if i just put hello as the text the npc will say hello

#

it doesnt overwrite or wtv

opal tree
#

Odd.. Sorry to ask the same thing but you've actually tested that?

#

If so I'd have to see the code where you are deciding what text to display

tulip wolf
#

yeah

#

i just tried it

#

it said hello

opal tree
#

Okay I see your goal

#

Okay assuming the choices table is an array table..

#

You need to do firstTimeTree.Choices[1].Response.Text = "New message here" instead of doing DialogueText.NpcText()

tulip wolf
#

okay hold on im creating a playerdata saver

#

@opal tree

#

'

#

what is this

#

^

#

i forgot

#

like what is it called

opal tree
#

a single quote?

tulip wolf
#

well i messed up that profile save

#

so

tulip wolf
#

it still says the same text

opal tree
#

did you implement my fix? let me see your code

tulip wolf
#

where would i implement it

tender kettleBOT
#

studio** You are now Level 6! **studio

tulip wolf
#

just to make sure

opal tree
#

Replace code in ss with

firstTimeTree.Choices[1].Response.Text = "New Message"
opal tree
tender kettleBOT
#

studio** You are now Level 6! **studio

opal tree
#

If so the string you put in the parameter is useless for some reason and you need to instead of removing the code just put what I provided above the existing code

tulip wolf
#

like this?

#

if so it still shows "test"

#

and this the other way

#

^^

#

@opal tree

opal tree
#

The problem is I don't know how your system works

#

It seems to just take the Text variable of the specific choice

#

My code changes that so it should work as long as it is done before the message is loaded/displayed

opal tree
# tulip wolf

why is the firstTimeTree variable underlined you need to make sure all the variables are proper I am doing it off my mind so yk

tulip wolf
#

okasy

#

hold on

#
    Id = "start",
    Text = "Hey there I'm Hook! Not to be confused with my brothers Line or Sinker... Anyways, what do ya need?",
    Choices = {
        {
            Text = "Sell Inventory",
            Command = function(player)
                local Backpack = player:FindFirstChild("Backpack")
                if not Backpack then return end

                local total = 0

                for _, item in ipairs(Backpack:GetChildren()) do
                    local valueObj = item:FindFirstChild("ItemValue")
                    if valueObj and valueObj:IsA("StringValue") then
                        local itemWorth = tonumber(valueObj.Value)
                        if itemWorth then
                            total += itemWorth
                            item:Destroy() 
                        end
                    end
                end

                local stats = player:FindFirstChild("leaderstats")
                if stats and stats:FindFirstChild("Coins") then
                    stats.Coins.Value += total
                end

                
                firstTimeTree.Choices[1].Response.Text = "You earned $" .. total .. " from your fish!"
                
            end,
            Response = {
                Id = "sellresult",
                Text = "test"
            }
        },
        {
            Text = "Fishing Inventory",
            Response = {
                Id = "inventory",
                Text = "w.i.p"
            }
        },
        {
            Text = "Fish Value",
            Response = {
                Id = "value",
                Text = "There's only one place right now, silly."
            }
        },
        {
            Text = "Nevermind",
            Response = {
                Id = "leave",
                Text = "Goodbye!"
            }
        }
    }
}

return function(player)
    player:SetAttribute("TalkedTo_ShowCase", true)
    return firstTimeTree
end
#

oh it sent

#

finally

opal tree
tulip wolf
#

still lined

opal tree
#

but I mean I'm positive my code is right and changes the text, so put my code inside of the function as before (Must be before the text variable is used elsewhere) and then under it do print(firstTimeTree.Choices[1].Response.Text"

tulip wolf
#

even if i write it

#

msg to lon g

#

still doesnt work tho 😭

#

can u write it by chance?

#

idk if im just writing it wrong

#

or wat

opal tree
#

Okay i got on studio for this it works

#

It even auto detects it

#

The code you are showing me isn't the code that actually displays the text above the npc's head and that is the root of the issue if it is still not working with the code I provided

tulip wolf
#

it is

opal tree
#

I do not see you making any text labels or anything visible wym it is

tulip wolf
#

well theres mulitple script

#

but this customizes what the npc is asying

#

whenever u interact with it

opal tree
#

All I know is the code I sent you will change the value of the Text variable, if it isn't working it is due to a different part of your system

#

Your og issue was some function you didn't show not properly displaying text, so whatever that function was doing isn't working right either, it should be doing the same thing as the code I provided to properly work

tulip wolf
#

do u want to see the diologuehandler or dialoguetext or state or visual

opal tree
#

idk which one is the cause of the issue lol you need to add print statements all up in your system to find out why it won't change

tulip wolf
#

ugh

#

its 5:51 am

#

ill do that some other time

tulip wolf
#

i cant just show u all the scripts?

opal tree
# tulip wolf hm

ima be honest bro at this point just give chat gpt ur entire system and tell it ur issue and to find the cause of the issue

#

Personally I am not about to learn your entire script system, the fix should've been as easy as what I provided you before

tulip wolf
#

ok

#

ill try that