Applying Text to Surface GUI Text

I am trying to make it to where once someone types in a textbox from a screenGUI, it appears on the surface GUI text. I tried the simpliest of things, but no change or error, any ideas?

Local Script:

local remote = game:GetService("ReplicatedStorage").RemoteEventlocal
local button = script.Parent.TextButton
local addressB = script.Parent.addressB
local value = script.Parent.Valuelocal
	
remote.MouseButton1Click:Connect(function()
	remote:FireServer(addressB)
end)

Server Script:

remote = game.ReplicatedStorage.RemoteEvent
address = script.Parent.Address
value = script.Parent.Value

remote.OnServerEvent:Connect(function(addressb)
	address.Text = addressb.Text
end)

why is there remote.MouseButton1Click???

doesn’t seem like functioning to me as you’re calling that event from a remote that does not exist, did you mean to use it on button???

addressb is set to be the player instance, .onserverevent returns player who fired the event, then arguments

server code would be:

remote = game.ReplicatedStorage.RemoteEvent
address = script.Parent.Address
value = script.Parent.Value

remote.OnServerEvent:Connect(function(plr, addressb)
	address.Text = addressb.Text
end)

I changed that up but it doesn’t seem to be working still, there is a call board with the address section, and what I type into the GUI, is supposed to show up on the surface GUI call board once I hit the button

The server can’t see the text that is entered client-side, so you should instead use :FireServer with the actual text.

Use:

remote.MouseButton1Click:Connect(function()
	remote:FireServer(addressB.Text)
end)

and on server-side:

remote.OnServerEvent:Connect(function(plr, addressb)
	address.Text = addressb
end)

Hope this helps.

1 Like

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