Scripts / Some simple scripts [Text on use, better doors, manual health pickup]

Author
Message
iiDenTiiTy
5
Years of Service
User Offline
Joined: 22nd Mar 2019
Location:
Posted: 23rd Mar 2019 00:13 Edited at: 23rd Mar 2019 01:48
Hi there!
So I've been starting to mess around with the LUA scripting aspect of GG after getting, somewhat the hang of the engine otherwise.
I am by no means, as you would say, any good at this what so ever. But learning it is the fun bit in my opinion. Absolutely come with feedback and improvements, I know a lot of this probably already exists out there already, but as I said I'm new to this.

All of these scripts depends on another function which detects if player is looking at an object, it is made by Smallg and can be found here: https://forum.game-guru.com/thread/207801?page=1HERE

So enough of all that, here are the aforementioned scripts:

Text on use

This script allows you to push "E" on an entity and it will display the entities name, my reason for making this was a simple note reading system. In the current code you see up there in prompts you to "Hold E to interact"(You can change that) and that text will then change to the name of the entity when you hold down E, which would be the contents of said note.
Put the script in your scriptbank and call it "textonuse.lua". Add the script to the item and make sure it is not static!

Better doors

Just the regular door script, but using the PlayerLooking function mentioned earlier.
This should be called "door2.lua".

Manual Health Pickup

Makes it so that you get a prompt when you are looking at the health item, same as with the text on use. And you use E to consume the item instead of automatically picking it up when close. This should be called "health_manual.lua".

Hopefully this is of some use to someone, I would love some feedback on them. I am having fun learning scripting in GG and will continue with that, so this list will most likely get expanded and improved. If you have any suggestions/requests on what I should work on next tell me below.

K. Bye!
PM

Login to post a reply

Server time is: 2024-12-22 13:57:56
Your offset time is: 2024-12-22 13:57:56