mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
57 lines
1.6 KiB
Lua
57 lines
1.6 KiB
Lua
|
|
--[[
|
||
|
|
| This file was obtained through the combined efforts
|
||
|
|
| of Madbluntz & Plymouth Antiquarian Society.
|
||
|
|
|
|
||
|
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||
|
|
| Maloy, DrPepper10 @ RIP, Atle!
|
||
|
|
|
|
||
|
|
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||
|
|
--]]
|
||
|
|
|
||
|
|
|
||
|
|
local PLUGIN = PLUGIN
|
||
|
|
|
||
|
|
PLUGIN.name = "Crystals"
|
||
|
|
PLUGIN.description = "A system that allows you to gather crystals!"
|
||
|
|
PLUGIN.author = "gb"
|
||
|
|
PLUGIN.version = 0.1
|
||
|
|
|
||
|
|
|
||
|
|
ix.util.Include("sv_hooks.lua")
|
||
|
|
ix.util.Include("sv_plugin.lua")
|
||
|
|
|
||
|
|
ix.config.Add("crystalSingularity", false, "Makes it so that singularities can be generated by crystals.", nil, {
|
||
|
|
category = "Crystals"
|
||
|
|
})
|
||
|
|
|
||
|
|
ix.config.Add("disableSuits", true, "Makes it so that blue crystals disable combine suits.", nil, {
|
||
|
|
category = "Crystals"
|
||
|
|
})
|
||
|
|
|
||
|
|
ix.command.Add("DestroyCrystal", {
|
||
|
|
alias = "BlowUpCrystal",
|
||
|
|
description = "Destroy the crystal entity you are looking at.",
|
||
|
|
adminOnly = true,
|
||
|
|
arguments = {
|
||
|
|
bit.bor(ix.type.bool, ix.type.optional)
|
||
|
|
},
|
||
|
|
OnRun = function(self, client, singularity)
|
||
|
|
local trace = client:GetEyeTrace()
|
||
|
|
local ent = trace.Entity
|
||
|
|
|
||
|
|
if IsValid(ent) and ent.Base == "crystal_base" then
|
||
|
|
if ent.OnDestroyed then
|
||
|
|
if singularity then
|
||
|
|
ent:OnDestroyed(true)
|
||
|
|
else
|
||
|
|
ent:OnDestroyed()
|
||
|
|
end
|
||
|
|
client:Notify("Destroyed the crystal entity you were looking at.")
|
||
|
|
else
|
||
|
|
client:Notify("The crystal cannot be destroyed.")
|
||
|
|
end
|
||
|
|
else
|
||
|
|
client:Notify("You are not looking at a valid crystal!")
|
||
|
|
end
|
||
|
|
end
|
||
|
|
})
|