I have my dialogue system, and it works great, but I want to be able to send updated values. On my previous game I did something like this
local FishSale = 0
GetArguments = function()
return {FishSale}
end,
Messages = {
[1] = {
Msg = "Hello!<Yield=0.5> What can I help you with?",
Choices = {
[1] = {Answer = "I want to sell my fish! π", NextQuery = 2},
}
},
-- Sell fish
[2] = function()
FishSale = SellFish:InvokeServer()
return 3
end,
[3] = {
Msg = "You have sold all your fish for %s"
},
}
local GetArguments = dialogueData.GetArguments ~= nil and dialogueData.GetArguments() or {}
local TotalMessages = dialogueData.Messages[NextSpeech]
if type(TotalMessages) == "table" then -- Normal dialogue
local Text = string.format(TotalMessages.Msg, table.unpack(GetArguments))
and the %s would input the FishSale, because if I just did β¦ FishSale β¦, it would print 0, even tho it should update cause of the invoke. So I had to use this format system to implement it. However, Iβm not entirely sure how or why it works? I wanna be able to store multiple items inside the table, and that way they update constantly, as my player can change their name and if I just do PlayerData.DisplayName.Value inside the string, itβll just get whatever it was when the module was required, and so I need to input some way of getting the updated version
GetArguments = function()
return {
PlayerData.DisplayName.Value,
PlayerData.FavoriteColor.Value
}
end,
Problem is when I do %s it only returns the DisplayName.Value. How can I seperate so I can get both?