Jump to content

Is there anyway to do this?


Slikpik

Recommended Posts

I've got a detonator. You aim at something that's locked with it and upon firing, it unlocks... The script compiles but it wont work in game. Here's the script

 

scn SLIKUnlocker

Short Item

Begin OnFire
	if (GetCrosshairRef GetLockLevel > 1)
	Set Item to GetCrosshairRef
	Unlock Item
	endif
end

 

 

What needs changed?

Link to comment
Share on other sites

Item needs to be a ref type, not a short type.

 

Edit: Also, unlock is a reference function, not a global function, so the proper syntax is Item.unlock

Edited by Xaranth
Link to comment
Share on other sites

Ok so I've changed the script a bit but it still wont unlock the item.

 

scn SLIKUnlocker

ref Item

Begin OnFire
	if (GetCrosshairRef GetLockLevel > 1)
		Set Item to GetCrosshairRef
		Item.Unlock	
	endif
end
Link to comment
Share on other sites

GetLockLevel is also a reference function. Try it this way:
set Item to GetCrosshairRef

if (Item.GetLockLevel > 0)
if (Item.GetLockLevel <= 100) ;Prevents it from unlocking 'requires key' locks.
Item.Unlock
endIf
endIf
Link to comment
Share on other sites

  • Recently Browsing   0 members

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