Why is script not working

i made this script to handle a remote event:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RevengeEvent = ReplicatedStorage:WaitForChild("RevengeEvent")

RevengeEvent.OnServerEvent:Connect(function(player)
    -- Add your logic here to handle the revenge event
    print(player.Name .. " triggered the revenge event!")

	local frametext = game.StarterGui.DialogGui.DialogFrame.text
	if frametext then
		frametext.Text = "yoo"
	end
end)


and it only prints that i triggered the revenge event but it doesnt change the text of the text label, am i doing something wrong? like can server scripts change texts of guis?

1 Like

Change starter gui to player gui

1 Like

They can change, if you want to change something on a specific player screen, then it should be playergui instead of startergui.

1 Like

it worked thx for helping me in this

btw, use startergui for localscripts and playergui with server side

1 Like

ok thx for telling me ill keep that in mind