Text not changed on screen

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? The output shows the text is changed but I don’t see it on the screen. The script is a script and is located inside the Server script service

  2. What is the issue? Here is some of the screen shot and vids.
    The location of the script
    image_2024-10-06_032905657
    Demo

  3. What solutions have you tried so far? I tried changing the script to change the text on the player’s GUI, but it doesn’t work. Do I need to do it using events?

player = game:GetService("Players")

player.PlayerAdded:Connect(function(plr)
	print(plr," joined!")
	
	local Text = plr.PlayerGui:WaitForChild("ScreenGui").Frame.TextLabel.Text

	wait(3)
	print("start")

	Text = "text1"
	print(Text)
	wait(3)
	Text = "text2"
	print(Text)
	wait(3)
	Text = "text3"
	print(Text)
	wait(3)
	
	print("end")

end)

It’s because this line:

local Text = plr.PlayerGui:WaitForChild("ScreenGui").Frame.TextLabel.Text

returns a string and not a reference, so if the TextLabel is empty the Text variable will be "" instead of an actual reference to the text.

So you need to do this:

local TextLabel = plr.PlayerGui:WaitForChild("ScreenGui").Frame.TextLabel
TextLabel.Text = "..."
1 Like

If I want the text to appear while a cut scene is happening, do I change the whole thing to a local script or does the cutscene have to be separated in another local script?

It depends on how you want to do it, you can change the text from the server script or you can create a RemoteEvent and use FireAllClients to play the cutscene locally

Ok, I’m going to try to use the remote event.

1 Like

I started a new topic since it is a bit unrelated.
https://devforum.roblox.com/t/creating-a-cutscene-using-remote-event/3183573?u=xxchocoelementxx

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.