Jump to content

Need some help with script


666989

Recommended Posts

Ok, so I'm working on a mod. And I can't seem to get it working, New to scripting and don't know if I'm overlooking something.

I have been working on the script but ran into an unknown error, when you drop the item after purchase upon interaction, typically you would pick it back up, it instead is supposed to allow you to rest/sleep. To pick it up you would first press Z + interaction button (E is default). So E-rest/sleep, Z+E-pick up item. But when you go to interact nothing happens, same with Z+interact.

Here's a copy of the script so far:

 

short dropped
ref marker

begin onadd
if dropped == 1
set dropped to 0
endif
end

begin ondrop
if dropped == 0
set dropped to 1
endif
end

begin onactivate

if isplayeractionactive 5 ; Z key object + E activate
activate ;pick up object
else ; regular E activate
ref refName
;make refname BedMattress01FloorR
set refName to BedMattress01FloorR
set refName to player.placeatme BedMattress01FloorR 1
refName.moveto Player
refName.disable
refname.markfordelete
endif

endif

Edited by 666989
Link to comment
Share on other sites

  • 2 weeks later...

ref refName

;make refname BedMattress01FloorR

set refName to BedMattress01FloorR

set refName to player.placeatme BedMattress01FloorR 1

refName.moveto Player

refName.disable

refname.markfordelete

endif

 

endif

I'm not a pro, not even close, but I noticed two things. The first line in red is not necessary at all, since you're setting that same variable to another value immediately after that, in the next line of the script. Secondly, I know you know this one: the block should end with an "end", not "endif".

 

To help prevent those mistakes and even typos you should try a program like Notepad++ and a syntax highlighter for FO3, such as this one. You can also try this, or just look around, there are other useful alternatives out there.

Edited by claustromaniac
Link to comment
Share on other sites

  • Recently Browsing   0 members

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