"Conversation" issues

So I have been working on a game, and I am trying to make a back and forth. Here is the code I use.
local debounce = 1
local Y = script.Parent.Frame.You.Text
local T = script.Parent.Frame.Them.Text

game.ReplicatedStorage.Talk2.OnClientEvent:Connect(function()
if debounce == 1 then
script.Parent.Frame.Active = true
wait(2)
Y = “Dang it”
wait(3)
T = “Is any of this real?”
wait(4)
Y = “Hopefully it was just a dream”
wait(3)
T = “I need to call somebody”
wait(2)
Y = “But I cant, I have to work”
wait(1)
T = “Urgh”
end
debounce = 0
end)

and

game.Workspace.KT.Touched:Connect (function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
wait(3)
game.ReplicatedStorage.Talk2:FireClient (game.Players:GetPlayerFromCharacter (hit.Parent) )
end
end)

Help would be appreciated. (Indents are correct)

So you can’t do this because you’ve defined the variables Y, T as the property .Text, which returns the value, not the actual property. You would need to do:

local Y = script.Parent.Frame.You

-- your other code
Y.Text = "Dang it"

etcetc

Thanks! (30 charrrrrrrrrrrrrrrrrrrrrrrr)

Hello there!

Before I try and make an attempt to help you, please format your code correctly for way easier readability, here’s how to do it and how it would look like for you:

luaformat

theformat

Whilst your at it, can you also tell me if there are any errors appearing in the output for you along with any other helpful additional information?

Can you give me the line before the local and the line after the local, I will try and fix it for you. :slightly_smiling_face:

I just forgot to remove the dots after You and them. I do have an error though. I cant get the frame to activate

Can you please answer the following question if the local is still underlined, I need to know the answer so I can give you the most accurate answer.

If not then can you tell us the new error that your getting?

Local isn’t underlined anymore, I just did something incorrectly. the lines of the conversation aka
wait(2)
Y = “Dang it”
wait(3)
T = “Is any of this real?”
wait(4)
Y = “Hopefully it was just a dream”
wait(3)
T = “I need to call somebody”
wait(2)
Y = “But I cant, I have to work”
wait(1)
T = “Urgh”

Isn’t making the text change, but I got the frame to work

local debounce = 1
local Y = script.Parent.Frame.You
local T = script.Parent.Frame.Them

game.ReplicatedStorage.Talk2.OnClientEvent:Connect(function()
	if debounce == 1 then
		script.Parent.Frame.Active = true
		wait(2)
		Y.Text = “Dang it”
		wait(3)
		T.Text = “Is any of this real?”
		wait(4)
		Y.Text = “Hopefully it was just a dream”
		wait(3)
		T.Text = “I need to call somebody”
		wait(2)
		Y.Text = “But I cant, I have to work”
		wait(1)
		T.Text = “Urgh”
	end
	debounce = 0
end)

game.Workspace.KT.Touched:Connect (function(hit)
	if game.Players:GetPlayerFromCharacter(hit.Parent) then
		wait(3)
		game.ReplicatedStorage.Talk2:FireClient (game.Players:GetPlayerFromCharacter (hit.Parent) )
	end
end)