Jump to content

Ownership script (Help?)


ArekkusuStorm

Recommended Posts

Alright so I have an object script attached to a misc item that changes it to another item and it works great. But the only problem I encountered was the ownership is set to.. someone else? I did a bit of research and discovered the "setownership" function so I gave it a try, nope did not want to work.

scn ASNexywoodScript

short CurX
short CurY
short CurZ
short CurAngleX
short CurAngleY
short CurAngleZ
ref PlaceMagazine

begin OnActivate
	if IsActionRef player == 1
		set CurX to GetPos x
		set CurY to GetPos y
		set CurZ to GetPos z
		set CurAngleX to GetAngle x
		set CurAngley to GetAngle y
		set CurAngleZ to GetAngle z
		set PlaceMagazine to ASNexywoodP1
		PlaceAtMe PlaceMagazine 1 0 0
		PlaceMagazine.SetPos x CurX
		PlaceMagazine.SetPos y CurY
		PlaceMagazine.SetPos z CurZ
		PlaceMagazine.SetAngle x CurAngleX
		PlaceMagazine.SetAngle y CurAngleY
		PlaceMagazine.SetAngle z CurAngleZ
		PlaceMagazine.SetOwnership PlayerFaction <-- I tried it without the PlayerFaction which should automatically set it to the player by default.
		Disable
		MarkForDelete
		Return
	endif
end
Edited by ArekkusuStorm
Link to comment
Share on other sites

Try this:

scn	ASNexywoodScript

ref	PlaceMagazine

begin OnActivate
	if IsActionRef player
		set PlaceMagazine to PlaceAtMe ASNexywoodP1 1
		PlaceMagazine.SetOwnership
		Disable
		MarkForDelete
	endif
end

I also removed all the positioning part, as I think it's redundant (PlaceAtMe object should, by default, inherit the 3d positioning of the object it is placed at).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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