✓ Accepted answer
Improvements
You need a Server and Local Script in order to use RemoteEvents properly
Use WaitForChild() to make sure an instance exists before using it
You can pass the TextBox 's Text Property to the Server as a parameter in the OnServerEvent
Issues
GetPropertyChangedSignal() is an event, and thus cannot be used to give a value in the way you are attempting
Local Script (under StarterGui)
local remote = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
local startgui = script.Parent
local box = startgui:WaitForChild("TextBox")
box:GetPropertyChangedSignal("Text"):Connect(function()
remote:FireServer(box.Text)
end)
Server Script (under Server Script Service)
local remote = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
local part = workspace:WaitForChild("GameTeleport"):WaitForChild("Tele")
local val = part:WaitForChild("ClickDetector"):WaitForChild("Script"):WaitForChild("GameId")
remote.OnServerEvent:Connect(function(player, text)
val.Value = text
end)
1 comment
do you want to change the text in the texbox?