You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? I want to make an admin gui which has a feature where you can teleport to players and you can teleport players to you.
-
What is the issue? I have a local script inside of the gui which handles sending a message to the Main script (which is a server script) via a remote event. The remote event is not the problem and instead it is the part where it gets the input from the text box in the gui.
-
What solutions have you tried so far? I have tried messing around with the local scripts code and the text box which has not worked.
Screenshot of explorer
Main script ( server script. relevant parts only)
--Variables--
player = script.Parent.Player.Value
TPToPlayer = game.ReplicatedStorage.RemoteEvents.TPToPlayer
--Teleport to player--
TPToPlayer.OnServerEvent:Connect(function(player,plr)
if workspace:FindFirstChild(plr) then
workspace[player].Head.CFrame = workspace[plr].Head.CFrame
TeleportToPrint.Text = "Success!"
else
TeleportToPrint.Text = "Could not find "..plr
end
end)
TPToPlayer (local script)
--Variables--
RE = game.ReplicatedStorage.RemoteEvents.TPToPlayer
B = script.Parent.Parent.TeleportToEnter
T = script.Parent.Text
plr = game.Players:FindFirstChild(T).Name
--Remote event--
B.MouseButton1Click:Connect(function()
RE:FireServer(plr)
end)