Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- RRPX Money Printer reworked for DarkRP by philxyz
- AddCSLuaFile("cl_init.lua")
- AddCSLuaFile("shared.lua")
- include("shared.lua")
- function ENT:Initialize()
- self:SetModel("models/props/cs_office/plant01.mdl")
- self:PhysicsInit(SOLID_VPHYSICS)
- self:SetMoveType(MOVETYPE_VPHYSICS)
- self:SetSolid(SOLID_VPHYSICS)
- local phys = self:GetPhysicsObject()
- if phys:IsValid() then phys:Wake() end
- self:SetNWBool("weed_plant", true)
- self.sparking = false
- self.damage = 100
- self.IsWeedPlant = true
- ply = self:GetNWEntity("owning_ent")
- if not ply.maxplants then
- ply.maxplants = 0
- end
- ply.maxplants = ply.maxplants + 1
- timer.Simple(30, self.CreateWeed, self)
- end
- function ENT:OnTakeDamage(dmg)
- self.damage = self.damage - dmg:GetDamage()
- if self.damage <= 0 then
- self:Remove()
- end
- end
- local function PrintMore(ent)
- if ValidEntity(ent) then
- timer.Simple(3, ent.CreateWeed, ent)
- end
- end
- function ENT:CreateWeed()
- if not ValidEntity(self) then return end
- if self:IsOnFire() then return end
- local WeedPos = self:GetPos()
- local weed = ents.Create("durgz_weed")
- weed:SetNWString("Owner", "Shared")
- weed:SetPos(Vector(WeedPos.x, WeedPos.y, WeedPos.z + 15))
- weed.nodupe = true
- weed:Spawn()
- weed:GetPhysicsObject():Wake()
- timer.Simple(math.random(100, 350), PrintMore, self)
- end
- function ENT:OnRemove()
- if not ValidEntity(ply) then return end
- if not ply.maxplants then
- ply.maxplants = 0
- return
- end
- ply.maxplants = ply.maxplants - 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement