Jump to content

me podrian ayudar


BlackSoul

Recommended Posts

este es un scrip que cree para k genere una torre pero el problema es que cuando genero la segunda torre la primera no desaparese, que tendria que hacer para que el primero desaparesaca ?? miren esto es lo que llevo

script

function CreateVisor ( thePlayer, commandName )
   if ( thePlayer ) then
      local x, y, z = getElementPosition ( thePlayer ) -- get the player's position
      -- create a Object next to the player:
      local theObject = createObject ( 3279, x + 5, y + 0, z + -1, 0, 0, 0 )
      if ( theObject ) then -- check if the Obeject was created successfully
         outputConsole ( "Visor puesto", thePlayer )
      else
         outputConsole ( "Visor no puesto", thePlayer )
      end
   end
end
addCommandHandler ( "visor", CreateVisor )

Link to comment
torres = {}

function CreateVisor ( thePlayer, commandName )
   if ( thePlayer ) then
      local x, y, z = getElementPosition ( thePlayer ) 
	  if torres[thePlayer] then
	     destroyElement(torres[thePlayer])
		 torres[thePlayer] = nil
	  end
      torres[thePlayer] theObject = createObject ( 3279, x + 5, y + 0, z + -1, 0, 0, 0 )
      if ( torres[thePlayer] ) then 
         outputConsole ( "Visor puesto", thePlayer )
      else
         outputConsole ( "Visor no puesto", thePlayer )
      end
   end
end
addCommandHandler ( "visor", CreateVisor )

 

Edited by alex17"
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...