Jump to content

New form in script


Dooge

Recommended Posts

Posted

If I know the ID of an item, how do I create a copy of it in the script?

        int ID = 12345
        form Item = (ID as form)

Incompatible types

 

 

 

Or

   		ObjectReference akItemReference 
		akItemReference = (123 as int)
Posted

Depends of you want to spawn a copy of the base object as ObjectReference or you want the real instance.

 

In the former case:

 

PlayerRef.PlaceAtMe(Game.GetFormEx(id))

 

In the latter case:

 

Form res = Game.GetFormEx(id)

 

Posted

 

Hullo ffabulous, long time no see. Thanks, that the thing I wanted. Code works now.

Depends of you want to spawn a copy of the base object as ObjectReference or you want the real instance.

 

In the former case:

 

PlayerRef.PlaceAtMe(Game.GetFormEx(id))

 

In the latter case:

 

Form res = Game.GetFormEx(id)

 

Thanks.

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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