z24d Posted October 14, 2015 Share Posted October 14, 2015 local sx,sy = guiGetScreenSize() local px,py = 1600,900 local x,y = (sx/px), (sy/py) -- Local Window -- teleportWindow = guiCreateWindow(x*633, y*272, x*223, y*239, ".:[ Players Teleports ]:.", false) guiWindowSetSizable(teleportWindow, false) guiSetAlpha(teleportWindow, 1.00) guiSetVisible ( teleportWindow, false) TheCheck = guiCreateCheckBox(x*41, y*199, x*158, y*15, "Cancel Warp To Me", false, false, teleportWindow) guiSetFont(TheCheck, "default-bold-small") guiSetProperty(TheCheck, "NormalTextColour", "FF20FE64") -- Local Gridlist -- teleportGridlist = guiCreateGridList(x*11, y*28, x*307, y*117, false, teleportWindow) teleportColumn = guiGridListAddColumn(teleportGridlist, "Players", 0.9) teleportButton = guiCreateButton(x*43, y*165, x*146, y*30, "Warp", false, teleportWindow) guiSetVisible ( teleportGridlist, false) guiSetVisible ( teleportButton, false) -- Function Open -- function open () if ( guiGetVisible ( teleportWindow )) or ( guiGetVisible ( teleportGridlist )) or ( guiGetVisible ( teleportButton )) then guiSetVisible ( teleportWindow, false ) guiSetVisible ( teleportGridlist, false ) guiSetVisible ( teleportButton, false ) showCursor ( false ) guiGridListClear( teleportGridlist ) else guiSetVisible ( teleportWindow, true ) guiSetVisible ( teleportGridlist, true ) guiSetVisible ( teleportButton, true ) showCursor ( true ) for i , player in pairs(getElementsByType("player")) do local addrow = guiGridListAddRow( teleportGridlist ) guiGridListSetItemText(teleportGridlist,addrow,teleportColumn, getPlayerName(player),false,false) end end end bindKey ( "F3", "down", open ) addEventHandler( "onClientGUIClick", guiRoot, function() if ( source == TheCheck ) then local CheckData = getElementData( localPlayer, "DataCheck" ) if ( guiCheckBoxGetSelected( source ) ) then if ( not CheckData ) or ( CheckData ~= true ) then setElementData( localPlayer, "DataCheck", true ) end else if ( not CheckData ) or ( CheckData ~= false ) then setElementData( localPlayer, "DataCheck", false ) end end elseif ( source == teleportButton ) then local addrow = guiGridListGetSelectedItem( source ) if ( addrow ~= -1 ) then local Target = getPlayerFromName( guiGridListGetItemText( source, addrow, 1 ) ) if ( Target ) then local CheckData = getElementData( Target, "DataCheck" ) if ( not CheckData ) or ( CheckData == false ) then local TargetX, TargetY, TargetZ = getElementPosition( Target ) setElementPosition( localPlayer, TargetX, TargetY, TargetZ + 2 ) end end end end end ) Where is the problem i should know : ) Link to comment
Wumbaloo Posted October 14, 2015 Share Posted October 14, 2015 You forgot false in the last function I think, after "end" Link to comment
TAPL Posted October 14, 2015 Share Posted October 14, 2015 At line 51 and 53 the source is a button as you've used if statement at line 50 to make sure it a button, you should replace source with your grid list variable on line 51 and 53. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now