Nightfox3 Posted February 7, 2016 Share Posted February 7, 2016 I am trying to make a script for a vendor machiene. When the activation-Object is activated, I want to receive an item 10 seconds afterwards.(I know, a bit long)But when I activate the object with the script in-game, nothing happens.After hours of looking for a solution on the web, I still don't know what I am doing wrong.So I decided to ask here. Here is my script: ScriptName MyTimer int timerint temp123 Begin OnActivate player set temp123 to 1 End Begin GameMode if(temp123 == 1) if (timer < 10) set timer to timer + GetSecondsPassed else player.additem 000340b5 1 set temp123 to 0 endif endif End Any kind of help is appriciated. Link to comment Share on other sites More sharing options...
Ladez Posted February 8, 2016 Share Posted February 8, 2016 GetSecondsPassed returns a float value, which will be rounded if it's added to an int variable, causing it not to increment. Change your timer variable to a float and it will work. Also, you don't need to use the hexadecimal form ID in scripts, the editor ID ShotGlass01 will work just fine and you will know what it is at a glance without having to look it up. Link to comment Share on other sites More sharing options...
Nightfox3 Posted February 8, 2016 Author Share Posted February 8, 2016 Yep, this fixed the problem :laugh:Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts