working on a dialogue script with option trees.
When I call the function it doesn’t change the text, but when I print the text it says its changed. Its not a local script.
cant tell if i’m being stupid or theres an actual issue here.
local folder = script.Parent
--how are you doing today?
-------------------------
local A10 = folder.A10
local A20 = folder.A20
local A30 = folder.A30 -- ENDBLOCK
-------------------------
local B10 = folder.B10
local B20 = folder.B20
local B30 = folder.B30 -- ENDBLOCK
-------------------------
local A1B1 = folder.A1B1
local A1B2 = folder.A1B2 -- ENDBLOCK
local A2B1 = folder.A2B1 -- ENDBLOCK
-------------------------
local B1A1 = folder.B1A1
local B1A2 = folder.B1A2 -- ENDBLOCK
local B2A1 = folder.B2A1 -- ENDBLOCK
-------------------------
function giveendblock(part, val)
local endblock = Instance.new("StringValue")
endblock.Name = "ENDBLOCK"
endblock.Value = val
endblock.Parent = part
end
function option(part, phrase, op1, op2)
local gui = part:FindFirstChild("SurfaceGui")
local text = gui.TextLabel.Text
local choice1 = part.choice1.Value
local choice2 = part.choice2.Value
text = phrase .. "Yes"
choice1 = op1
choice2 = op2
end
option(A10, "Thats great to hear", "thanks","I appreciate it")