How can I make a textbox on a part that is editable and serversided (Not clientsided)

Heey, so im tryna make a textbox that CAN be edited and it is showed on every players client. I already have it but it turned out client sided :confused: if anyone cant help that would be great :slight_smile:

You could use a ClickDetector and put it inside the part, then whenever it’s clicked you allow the player to change the text box.

Sorry but, how exactly would that work?

There’s a an event called Clicked from the ClickDetector, and it passes in an argument to the connected function which gives the information of who clicked the ClickDetector.

I dont think i’d need the click detecter due to it already being clickable, heres what it does.

Every time the text is edited, you need to fire an event to the server which makes the dummy speak. Something like:

-- Local script
local event = -- the event path

clickDetector.Clicked:Connect(function()
    event:FireServer(textBox.Text)
end)

-- Server script
local event = -- the event path

event.OnServerEvent:Connect(function(plr, message)
    chatService:Chat(dummy, message)
end)

There’s no click detector. Its a textbutton

Then instead of that, you can detect when the button was clicked.

That’s what i did, still didnt work

button.MouseButton1Click:Connect(function()
	mainEvent:FireServer(textBox.Text)
end)

My bad, you don’t need to use events. I think you’re using a local script and that’s why it won’t work. Just replace it with a normal server script and put both the click detection and chat in there. This should probably work:

button.MouseButton1Click:Connect(function()
    chatService:Chat(dummy, textBox.Text, "White")
end)

Thats what i had at the start. :grimacing: