Gmod Mana System + HUD Creator - Script
Do you want to add a magic bar to your server, which is aesthetically changeable and unique with the possibility to give it various shapes, colors, positioning? Or do you want a gauge system to restrict the use of magic (Mana or Force), disable the use of magic by DarkRP jobs or by Rank? "Gmod Mana System + HUD Creator" does all three.
❮
❯
Description of Gmod Mana System + HUD Creator
Summary:- ๐ Addon description: Gmod Mana System + HUD Creator
- ๐ฆ Contents
- ๐ฎ Max Mana Level Upgrade System
- ๐ช Mana bar customization system
- ๐น๏ธ The Commands
- ๐พ Backup and persistence
- โ๏ธ Pre-scripted mana recharge items in Gmod Mana System + HUD Creator
- ๐ง APIs associated with User Class for coders and object creation
- โ๏ธ Compatibility with gamemodes
- ๐ List of HUDs collection
๐ Addon description: Gmod Mana System + HUD Creator
Gmod Mana System + HUD Creator is the latest in my long series of HUDs with their own standalone systems. I always said that I would never make simple HUDs when I was asked to make HUDs. This is still true today. I didn't just make HUDs, I made complete systems with their editable gameplay rules with their customizable HUDs in real time.
Gmod Mana System + HUD Creator is part of it, it will allow you to add a magic gauge system with various options of restriction by jobs or rank, and a nice glowing magic gauge on the interface of your players connected to your Gmod server, this magic bar is of course as the title indicates aesthetically modifiable and unique with the possibility to give it various shapes, colors, positioning.
A system to restrict the use of magic by DarkRP jobs and by Rank. For example a citizen has no magic.
How it happens on the user side, the user doesn't see the administration menus to start with, you will have the possibility to make your users have no magic at all at the beginning of their game. They will either have to evolve (LevelUP) or find artifacts to unlock the maximum amount of magic. Just like you can choose if they already have the maximum magic at the beginning. Everyone governs the rules of their server as they see fit.
The script does not include spells or special effects. It provides a complete system with its APIs, for example to block the use of a weapon or a wand if the mana is less than the required amount of mana it will be enough to place in the code of the weapon:
To restrict the use of a weapon that requires 20 points of magic for example :
if self:GetOwner():Mana() < 20 then
return
end
To remove mana when using a wand or a spell that costs 20 magic points: player:addMana(-20)
A documentation translated in several languages provides more details about the different possibilities.
๐ฆ Contents
You will find:
1. An sql database system to store user progress.
2. A magic restriction system, for example no magic for Muggles or ordinary citizens.
3. A module to manage the magic system according to the ranks: superadmin, admin, moderator, vip, user, etc.
4. Modular magic bar in the HUD with the HUD Creator.
5. A Management Module of the magic system according to the DarkRP JOBS: mayor, citizen, vip, etc.
6. A customization system for the magic bar in the HUD.
7. A large number of customizable HUD styles.
8. A max magic upgrade entity either by level or by magic extension item.
9. Sample potions for creating your own entities.
10. Gameplay customization options.
11. Various potions available in the workshop in a potion pack that you can use as examples and develop your own potions.
12. And of course a support.
๐ฎ Max Mana Level Upgrade System
With Gmod Mana System + HUD Creator, you will be able to choose if the max magic increases with the level of the user, provided you have a leveling system installed on your server garry's mod, you will find one of my collection in the store / Section Gmod addons
It will be possible to choose the upgrade possibilities of max magic either by finding a spawnable key item as well, or depending on the level of your users. The progress of your users is recorded when they log out.
๐ช Mana bar customization system
The magic system HUD is made for you to express your creativity, as in my editable HUD collection the magic bar is fully customizable, from icons to style to shape and position. No need for file updates or workshops. All you see when editing is a preview, don't forget to save to apply your changes.
List of HUD customization choices (I took care to make a modification by screenshots above):
Vertical and horizontal position, Length and Width, Bar background color, Progress bar color, Text color, Icon color, Font, Replace default magic icons with your own by simple image link, various pre-saved HUD styles, real-time creation and no gmod reboot.
๐น๏ธ Commands
To access the interface the chat command : !mana
The console command : norda_hud_mana_system
๐พ Backup and persistence
Like most of my player stats management scripts, the player's evolution is saved at the time of disconnection for optimization reasons, it's a choice you can make from the configuration file.
โ๏ธ Pre-scripted mana recharge items in Gmod Mana System + HUD Creator
The addon includes a spawn menu of potions that you can add in the table of items in the configuration file, you will only need a model, a sound and when the potion is spawned the model will be displayed and if you drink the potion the sound will be played.
The potions already present named potion_blue and potion_red serve as examples to help you create your own, you can then with my other scripts designate them as loot in containers, or Loot spawn point to spawn on the map, or loot when a Npc dies, or at a merchant.
You will be able to choose the values of each potion, for example if it affects life points, armor points, stamina, magic, hunger etc... A potion can have more or less values than another one according to your own choice. You can do this with the potions already present or those you add.
An item called max magic upgrade will give you the possibility to increase the max capacity of the magic bar. This kind of upgrade can be disabled so the max mana will depend only on the level of the player.
๐ง APIs associated with the User Class for coders and object creation
1. Lua functions: Client and Server :
player:Mana() = Allows to know the remaining magic points of the user.
player:GetMaxMana() = Returns the user's maximum magic points.
2. Lua functions : Server :
player:addMana(number) = Allows you to give or remove magic. For example. 20 = Adds 20 magic to the magic gauge. -20 Removes 20 for example when using a spell.
player:setMana(number) = Allows you to set the player's magic gauge.
player:addMaxMana(number) = Allows you to increase or decrease the max magic. If you want to create entities that upgrade or downgrade the max magic points, you can do so.
player:setMaxMana(number) = Allows you to set the max magic points of the player. By default the max magic is capped at 200. You can lift this limit in the configuration file.
โ๏ธ Compatibility with gamemodes
Compatible with DarkRP, CityRP, SCPRP, StarwarsRP, HogwartsRP, HogwartsRP, CloneRP, MilitaryRP, AnimRP, MangaRP, ect... It is a system on its own so it does not depend on a gamemode.
๐ List of HUDs collection
Gmod Mana System + HUD Creator is part of the HUD collection:
Gmod Leveling System
Gmod Health Modules + HUD Editor
Gmod Stamina System + Customisable HUD
Gmod Hunger Mod + Customizable HUD
Gmod Thirst Mod + HUD Builder
Gmod Mana System + HUD Creator
Path: garrysmod/addons/norda_hud_mana_system
- The AddWorkshop function is automatically added to the script server file and can be deactivated from the configuration file. : resource.AddWorkshop( 2731848652 )
- To add gmod workshop resources to your collection : Gmod Mana System + HUD Creator [Content Only] | Gmod Workshop
function SWEP:PrimaryAttack()
ply:addMana(-10)
end
function SWEP:SecondaryAttack()
ply:addMana(-10)
end
function SWEP:PrimaryAttack()
local ply = self:GetOwner()
if ply:Mana()<10 then return end
ply:addMana(-10)
---- YOUR CODE ----
end
function SWEP:SecondaryAttack()
if self.Owner:Mana()<10 then return end
ply:addMana(-10)
---- YOUR CODE ----
end
cfg.Potion_List=cfg.Potion_List or {}
local Potion_List={
potion_blue={
Name="Potion Blue",
Model="models/props_junk/popcan01a.mdl",
Sound="physics/glass/glass_bottle_impact_hard1.wav",
Life=0,
Armor=0,
Stamina=0,
Food=0,
Thirst=0,
Mana=50,
},
potion_red={
Name="Potion Red",
Model="models/mechanics/various/211.mdl",
Sound="physics/glass/glass_bottle_impact_hard1.wav",
Life=0,
Armor=0,
Stamina=0,
Food=0,
Thirst=0,
Mana=100,
},
}
Insert the number you need.
In the configuration file :
cfg.Ent_Lifetime=30 -- 0 = OFF
cfg.Mana_start = 100 -- By default the starting mana is 100. 0 = players will arrive with 0 magic.
cfg.MaxMana_define_per_lvl = 0 --0 = The player must find items to upgrade the max magic, 1 = The max magic evolves with the level
cfg.MaxMana_max = 200 -- By default the max magic cannot go above 200. Change this value to change the limit of the max magic, a user will not be able to go above it.
cfg.MaxMana_gain_per_levelup = 10 -- 10 = 10 points per level. A level 5 player will have 50 magic points max.
Either you add: at Zero or below 0 the weapon does not attack anymore.
//CanPrimaryAttack or CanPrimaryAttack
function SWEP:CanPrimaryAttack()
if ( self.Owner:Mana() <= 0 ) then
self:SetNextPrimaryFire( CurTime() + 0.2 )
return false
end
return true
end
Either find the PrimaryAttack or/and SecondaryAttack function of the swep and add to the first line: if ( self.Owner:Mana() <= 0 ) then return end if a player has 0 in mana he will not be able to attack. If your weapon has a mana cost, for example 4 then replace <= 0 with < 4.
function SWEP:PrimaryAttack()
if ( self.Owner:Mana() <= 0 ) then return end
-- The code contained in the function
end
if player:Mana()<10 then return end
If the user has less than 10 mana points: if player:Mana()<10
Tip to avoid the leak of Gmod Mana System + HUD Creator installed on your Garry's Mod server: How avoid the Leak of your Gmod scripts
How Install an addon on Gmod? : How install an addon on Gmod
How Publish an addon on the Gmod workshop? : Documentation how create a content pack to publish on the workshop?
Creator: Norda Scripts
Sales | 42 |
Published | 2 years |
Last update | |
Version | version 2.7 |
DRM | Yes |
Categories | Gmod addons |
Requierements | Garry's Mod Server |
Languages | ๐ฌ๐ง ๐ซ๐ท ๐ฉ๐ช ๐ท๐บ ๐ช๐ธ |
DarkRP HUD Gameplay Management Allgamemode |