Hello all i was wondering if you can help me fix something. I'm not getting errors just what ever Teleport i click inside the Grid list it teleports to the same place
GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Memo = {}
GUIEditor_Grid = {}
GUIEditor_Window[1] = guiCreateWindow(0.2884,0.2591,0.3909,0.6536,"Teleporter by Twisted",true)
guiSetVisible(GUIEditor_Window[1],false)
showCursor(false)
GUIEditor_Grid[1] = guiCreateGridList(0.0562,0.1116,0.6161,0.8167,true,GUIEditor_Window[1])
guiGridListSetSelectionMode(GUIEditor_Grid[1],2)
guiGridListAddColumn(GUIEditor_Grid[1],"Teleports",0.5)
GUIEditor_Button[1] = guiCreateButton(0.6854,0.8327,0.2884,0.0916,"Close",true,GUIEditor_Window[1])
guiSetProperty(GUIEditor_Button[1],"NormalTextColor","FF00FF00")
GUIEditor_Memo[1] = guiCreateMemo(0.6985,0.1355,0.2659,0.6713,"This teleporter script was made by Twisted and should not be shared without concent Copyrighted(C) Double click the Teleporter u wish to Travel too \"{SMILIES_PATH}/icon_smile.gif\" alt=\"\" title=\"Smile\" /> ",true,GUIEditor_Window[1])
guiMemoSetReadOnly(GUIEditor_Memo[1],true)
function open()
if (guiGetVisible(GUIEditor_Window[1],true)) then
guiSetVisible(GUIEditor_Window[1],false)
showCursor(false)
else
guiSetVisible(GUIEditor_Window[1],true)
showCursor(true)
end
end
bindKey("F4","down",open)
function close()
if (source == GUIEditor_Button[1]) then
guiSetVisible(GUIEditor_Window[1],false)
showCursor(false)
end
end
addEventHandler("onClientGUIClick",getRootElement(),close)
function addTeleports()
guiGridListClear(GUIEditor_Grid[1])
if (guiGetVisible(GUIEditor_Window[1]) == true) then
local file = xmlLoadFile("Teleports.xml")
if file then
for i,v in ipairs(xmlNodeGetChildren(file)) do
local name = xmlNodeGetAttribute(v,"name")
local row = guiGridListAddRow(GUIEditor_Grid[1])
guiGridListSetItemText (GUIEditor_Grid[1], row, 1, tostring(name), false, true)
end
end
end
end
addEventHandler ("onClientRender",getRootElement() , addTeleports)
function teleport()
local file = xmlLoadFile("Teleports.xml")
if file then
for i,v in ipairs(xmlNodeGetChildren(file)) do
local poX = xmlNodeGetAttribute(v,"posX")
local poY = xmlNodeGetAttribute(v,"posY")
local poZ = xmlNodeGetAttribute(v,"posZ")
setElementPosition(getLocalPlayer(),tostring(poX),tostring(poY),tostring(poZ))
outputChatBox("You have Teleported unharmed",255,255,255)
end
end
end
addEventHandler("onClientGUIDoubleClick",GUIEditor_Grid[1],teleport)
<Teleports>
<Teleports name="Santa Maria Beach" posX="302" posY="-1780" posZ="4"/>
<Teleports name="Middle of map" posX="0" posY="0" posZ="3"/>
</Teleports>
No debug errors already checked.
Hope you can help me Thanks