Need help getting overhead Gui to work

Hello, I have made an overhead gui that displays text, I have been trying to make it so you could change the text it displays through a textbox in a gui. I am using a Remote Event to achieve this, for some reason even though the server is firing and the client the text is not changing, no errors either.

Default Value is 'XYZ' btw
Confused.

I have tried searching for solutions but can’t seem to find anything, I have tried altering the scripts many time but I am honestly confused.

Local Script

local txt = game.ReplicatedStorage.Text
local text = player.PlayerGui.ButtonHandler.SettingsGui.SettingsFrame.XYZTagText.TextBox.Text

script.Parent.MouseButton1Click:Connect(function()
		if enter == false then
			enter = true
txt:FireServer(player, text)
			print('ff')

ServerScript

txt.OnServerEvent:Connect(function(player, text)
	local text = player.PlayerGui.ButtonHandler.SettingsGui.SettingsFrame.XYZTagText.TextBox.Text
	player.Character.Head:FindFirstChild('Tag').TextBox.Text = text
	print('dd')
end)

youre getting the textbox text when the script runs and not when you press the button, put the text variable in the mousebutton1click event

You said overhead right? so you have to get the Billboard Gui inside the player character it commonly inside the Head or HumanoidRootPart. In your case your code doesn’t getting the text from RemoteEvent instead you taking the Text from the PlayerGui.

I have it parented to the head, everything works beside the text changing. How could I get the text from the RemoteEvent instead of PlayerGui? Haven’t really done much with RemoteEvents so I’m trying to learn how to utilize them.

Just use the text variable passed on the top function(player, text) try it

txt.OnServerEvent:Connect(function(player, text)
	player.Character.Head:FindFirstChild('Tag').TextBox.Text = text
	print('dd')
end)
1 Like

I am now getting this error.

All good now, fixed it. Thank you for the help!

1 Like

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