function createPanel(commandName)
local window = guiCreateWindow(532, 373, 232, 171, "TELEPORTER POSITION", false)
guiWindowSetSizable(window, false)
local button_1 = guiCreateButton(141, 99, 64, 25, "EXIT", false, window)
-- guiSetAlpha(button_1, 0.42) --
local button_2 = guiCreateButton(32, 99, 64, 25, "TELEPORT", false, window)
local edit_box = guiCreateEdit(42, 37, 153, 21, "0,0,0", false, window)
showCursor(true)
addEventHandler("onClientGUIClick", button_1,
function()
if isElement(window) then destroyElement(window)
showCursor(false)
end
end)
addEventHandler("onClientGUIClick", button_2,
function(player)
local x, y ,z = string.match(guiGetText(edit_box), "(%d+), (%d+), (%d+)")
x, y, z = tonumber(x), tonumber(y), tonumber(z)
setElementPosition(player, x, y, z)
end)
end
addCommandHandler("tp", createPanel)
To use this script, the player can enter the desired coordinates in the format "x, y, z" in the edit box and click the "TELEPORT" button. This will teleport the player to the specified coordinates.