paladicprince Posted October 8, 2009 Share Posted October 8, 2009 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 More sharing options...
QQuix Posted October 9, 2009 Share Posted October 9, 2009 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 More sharing options...
paladicprince Posted October 9, 2009 Author Share Posted October 9, 2009 Thanks for the reply Sir. :) I actually had finally figured that out but kudos to you anyways. :) Link to comment Share on other sites More sharing options...
Recommended Posts