I am trying to make simple dialogue, for some reason I can’t change the text in a TextLabel from a Local Script, In a server script this works fine but only the server can see it, if you switch to the players client the text only changes once to “hi”, I am new to scripting and this continues to be a issue since I can’t find a good solution to my problem.
I even tried the code alone without the function with a print at the end, but still doesn’t change the text label but will for some reason still print into the output.
I also checked the TextLabel it’s self which I found nothing wrong with it.
local players = game:GetService("Players")
local ui = game:GetService("StarterGui")
local txt = ui.Dialogue.txt
local re = game:GetService("ReplicatedStorage")
local ev = re.PlayerJoined
local function OnClientEvent(ev)
txt.Text = ("hi")
task.wait(1)
txt.Text = ("who are you?")
task.wait(1)
txt.Text = (" ")
end
players.PlayerAdded:Connect(OnClientEvent)