Important: Dialogue is created with Roblox Dialogue Editor(Glossy ver.)
So I’ve created a dynamic choice and prompt basically what the NPC says that changes based on what the NPC’s initial prompt was. For example. If the NPC says ‘How are you?’ then the choice would be “I’m good”. However, if the NPC says something like 'Do you wanna go fishing with me? the choice would be ‘Sure’.
Ever since I’ve wrote this function and implemented it. I always get this error, which is.
[08:42:57.172 - ReplicatedStorage.RobloxDialogue.Class.Server:89: attempt to concatenate a nil value]
There are no errors in the function I wrote so far. There may be, however. If I remove the function the dialogue goes smoothly without the error coming up. However, dialogues are one of the crucial parts of my game. Without them, the player will not progress.
Here’s the snippet from the two functions that I’ve written that caused this error.
How my system works is that each NPC will have 5 folders of dialogues for each relationship level. Around 3-6 instances which are
StringValues. A function will check the relationship level and if 1hour is up There is a one hour delay per potential friendship increasing text.. If conditions are met, then it will return the randomly selected text and by chance, will increase friendship level. Then, the two functions above will check the dialogue line to see if there will be a choice. If no, then dialogue ends once the player closes it.
dialogueResponse = function(player,dialogueFolder,node) if currentString == "Hey what's your name?" then --current string is the initial prompt that the NPC says that is set depending on the friendship level currentResponse = "My name's Min. How about you?" return currentResponse -- this is the part where 'currentResponse' will be the response text end end, dialoguePrompt = function(player,dialogueFolder,node) if currentResponse == "My name's Min. How about you?" then --current response is set by the 'dialogueResponse' function return "I'm Grizz. I remember you! I used to play with you when you were a child!" --returns NPC reply as text so that it can be displayed in the dialogue GUI. end end,