Scripts / Need little help with a door

Author
Message
Shadow_Master
4
Years of Service
User Offline
Joined: 7th Oct 2020
Location:
Posted: 1st Jul 2022 19:50 Edited at: 1st Jul 2022 19:52
I got this door to pop up when the player collects the ammo (so they cannot shoot the secretary in the back) my Question is once the player is out of ammo, how do I get the door to re-open? or am I thinking to far ahead again lol

Before the player gets the ammo

After the player gets the ammo



Here is a video of the door in action and my crazy shooting lol
https://screenrec.com/share/VsopIAUvZl

Attachments

Login to view attachments
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 1st Jul 2022 21:47
if player ammo > 0 the door close
else
the door open
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Shadow_Master
4
Years of Service
User Offline
Joined: 7th Oct 2020
Location:
Posted: 1st Jul 2022 22:48
@3com, where do I put the following code?

if player ammo > 0 the door close
else
the door open

Sorry, still learning code and Max since it going be a while before TGC team get to RPG .

The TGC are focused on killing bugs first which I totally understand and agree with. I am just pushing what we already have in Max to try and make a RPG game while I wait.

Also is there a good way of learning Lua scripting for beginners? Or a Lua book for coding that I can buy to help me with learning scripts?
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 2nd Jul 2022 10:30 Edited at: 2nd Jul 2022 10:30
@ Shadow_Master
Go to "Documents\GameGuruApps\GameGuruMAX\Files\scriptbank\user"; if these folders do not exist, create them, and save the attached script there.

Follow the video steps. I guess you are looking for a sliding door.

https://youtu.be/o13fL6xDFr8

About learning LUA - there is a lot of stuff out there, these two might help to start with it.

https://forum.game-guru.com/thread/208970
https://www.lua.org/start.html

Note: Next time, please post this sort of issue on the script forum, there you might get more help.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

Attachments

Login to view attachments
PM
Shadow_Master
4
Years of Service
User Offline
Joined: 7th Oct 2020
Location:
Posted: 2nd Jul 2022 20:14
Thank you so much @3com it perfect
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 2nd Jul 2022 23:14
@ Shadow_Master
Glad to help
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM

Login to post a reply

Server time is: 2024-11-21 12:08:38
Your offset time is: 2024-11-21 12:08:38