Jump to content

My 5 second mod is up to 45 minutes


paladicprince

Recommended Posts

Hi. I'm trying to create a script to pick up books without reading them by holding left shift while you press activate. This is the script I've been working with so far:

 

scn PPPickUpBookScript

float fQuestDelayTime

Short Temp
Short DoOnce

Ref Crosshair

Begin GameMode

If (DoOnce == 0)
Set fQuestDelayTime to .01
Set DoOnce to 1
EndIf

If (IsKeyPressed3 42)
Set Crosshair to GetCrosshairRef
If (Crosshair.IsBook)
	DisableKey 18
	Set Temp to IsKeyPressed3 18
	If (Temp)
	Message "Hi! %.0f", Temp
		Player.AddItem Crosshair 1
		Crosshair.Disable
	EndIf
EndIf
Else
EnableKey 18
EndIf

End

 

Eveything works correctly up until the additem. It even displays the message when I press e. I'm guessing this problem is caused by the fact that the objects are not marked persistent. Does anyone know a way around that?

Link to comment
Share on other sites

Objects found in the world are references. Therefore GetCrosshairRef returns references.

 

AddItem needs a Base Object as a parameter.

 

To get the Base Object of the book, add a "Set Crosshair to Crosshair.GetBaseObject" before the AddItem line.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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