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)
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"
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:
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.
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)