LuaWindow class
#7
Maybe something like this?:
function HandleCommand( Split, Player )
	local MyOnSlotChangeFunction = function(Player, ChangedSlot)
		if Window:GetSlot( ChangedSlot ) == E_ITEM_EMERALD then
			Player:TeleportTo( X, Y, Z )
		elseif Window:GetSlot( ChangedSlot ) == E_ITEM_DIAMOND then
			Player:TeleportTo( X, Y, Z )
		elseif Window:GetSlot( ChangedSlot ) == E_BLOCK_DIRT then
			Player:SendMessage( cChatColor.Rose .. "Dirt is nothing worth" )
		else
			--Some code here
		end
	end
	local MyOnWindowCloseFunction = function( Player )
		Player:SendMessage( cChatColor.Rose .. "Pick something please" )
	end
    Window = cLuaWindow(cWindow.Chest, 3 * 9);
    Item = cItem( E_BLOCK_DEAD_BUSH, 1, 0, 0 );
    Window:SetSlot( 1, Item );
    Window:SetOnSlotChange(MyOnSlotChangeFunction);
    Window:SetOnWindowClose(MyOnWindowCloseFunction);
    Player:OpenWindow( Window );
end
Reply
Thanks given by:


Messages In This Thread
LuaWindow class - by NiLSPACE - 05-29-2013, 05:20 AM
RE: LuaWindow class - by xoft - 05-29-2013, 06:00 AM
RE: LuaWindow class - by NiLSPACE - 05-29-2013, 07:21 AM
RE: LuaWindow class - by xoft - 05-29-2013, 07:20 PM
RE: LuaWindow class - by NiLSPACE - 05-29-2013, 11:41 PM
RE: LuaWindow class - by xoft - 05-29-2013, 11:53 PM
RE: LuaWindow class - by NiLSPACE - 05-30-2013, 12:04 AM
RE: LuaWindow class - by xoft - 05-30-2013, 12:23 AM
RE: LuaWindow class - by NiLSPACE - 05-30-2013, 12:28 AM
RE: LuaWindow class - by NiLSPACE - 05-30-2013, 03:50 AM
RE: LuaWindow class - by xoft - 05-30-2013, 04:58 PM
RE: LuaWindow class - by xoft - 05-30-2013, 10:25 PM
RE: LuaWindow class - by xoft - 05-31-2013, 02:22 AM
RE: LuaWindow class - by FakeTruth - 05-31-2013, 03:05 AM
RE: LuaWindow class - by xoft - 05-31-2013, 04:37 AM
RE: LuaWindow class - by FakeTruth - 05-31-2013, 05:10 AM
RE: LuaWindow class - by xoft - 05-31-2013, 05:48 AM
RE: LuaWindow class - by NiLSPACE - 05-31-2013, 06:37 AM
RE: LuaWindow class - by xoft - 05-31-2013, 06:43 AM
RE: LuaWindow class - by xoft - 05-31-2013, 05:21 PM
RE: LuaWindow class - by NiLSPACE - 06-01-2013, 01:29 AM
RE: LuaWindow class - by xoft - 06-01-2013, 03:34 AM
RE: LuaWindow class - by NiLSPACE - 06-01-2013, 03:58 AM
RE: LuaWindow class - by xoft - 06-01-2013, 06:20 PM
RE: LuaWindow class - by NiLSPACE - 06-02-2013, 12:28 AM
RE: LuaWindow class - by bearbin - 06-02-2013, 12:43 AM
RE: LuaWindow class - by NiLSPACE - 06-02-2013, 12:46 AM
RE: LuaWindow class - by xoft - 06-02-2013, 02:31 AM
RE: LuaWindow class - by NiLSPACE - 06-02-2013, 02:34 AM
RE: LuaWindow class - by xoft - 06-02-2013, 07:13 AM
RE: LuaWindow class - by xoft - 06-02-2013, 07:29 PM
RE: LuaWindow class - by bearbin - 06-02-2013, 08:40 PM
RE: LuaWindow class - by xoft - 06-02-2013, 08:44 PM
RE: LuaWindow class - by xoft - 06-03-2013, 08:00 AM



Users browsing this thread: 13 Guest(s)