Local Script wont change text label, and Server Script only changes it for the Server which players cant see?

I tried this, but still nothing worked.

Though I’m not sure if this means anything, but after I tried testing this in a local script I again tested it in a Server Script in ServerScriptService and got this error. This error doesn’t show up whenever I set it to a Local Script so this error might just be due to it being a Server Script

This error is because you cant get localplayer from serverscript

For the .LocalPlayer to work, as it states, it needs to be on a local script. Could you please get the script back to StarterPlayerScripts?

Yes I have already set it back to a Local Script in StarterPlayerScripts,

Still nothing changes

This is my current script at the moment:

task.wait(2)

local players = game:GetService("Players")

local re = game:GetService("ReplicatedStorage")

local player = players.LocalPlayer
local plrUI = player.PlayerGui
local text = plrUI:WaitForChild("Dialogue").txt

repeat task.wait() until player.CharacterAdded:Wait()

local function OnClientEvent()
	warn("Warn has printed")
	
	text.Text = ("hi")

	task.wait(1)

	text.Text = ("who are you?")

	task.wait(1)

	text.Text = (" ")

end

task.spawn(OnClientEvent)  ```
1 Like

I think the culprit is the repeat task.wait() until player.CharacterAdded:Wait(), since everything before that seems to be running fine. Sorry for suggesting that, I thought it could’ve worked, but I guess not.

try this please in starter gui

task.wait(2)
local re = game:GetService("ReplicatedStorage")
local player = game.Players.LocalPlayer
local plrUI = player.PlayerGui
local text = plrUI:WaitForChild("Dialogue").txt


local function OnClientEvent()
	warn("Warn has printed")

	text.Text = ("hi")

	task.wait(1)

	text.Text = ("who are you?")

	task.wait(1)

	text.Text = (" ")

end

task.spawn(OnClientEvent)
5 Likes

Thank you both this worked perfectly! I appreciate you guys taking the time out of your day to help me, please take care and farewell! :grin:

3 Likes

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