Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Made by AC²
- // For dP
- // Download and load shared.lua
- AddCSLuaFile("shared.lua")
- --AddCSLuaFile("cl_init.lua")
- include("shared.lua")
- // It has loaded!
- MsgN("=====================")
- MsgN("[[ Chest ]]")
- MsgN("[[ By AC ]]")
- MsgN("=====================")
- // Random Table
- local ChestSpawnPoints = {
- Vector( 4701.548828, 1676.690063, 40.031250 ),
- Vector( 1740.472778, -1362.380615, 40.031250 ),
- Vector( -1400.435303, -1595.658936, 40.031250 ),
- Vector( 6715.950195, 2726.604736, 40.031250 ),
- Vector( -13726.212891, 416.761536, -1010.398071 ),
- Vector( -6965.378418, -6382.761230, 72.528206 ),
- Vector( 447.454834, -3545.223633, 45.031250 ),
- Vector( 1667.111816, -5442.578613, 50.031250 ),
- Vector( 3308.397705, -8873.604492, 40.041061 ),
- Vector( 6946.916504, -7970.968750, 30.031250 ),
- Vector( 6506.471680, -5165.207031, 30.031250 ),
- Vector( 10557.391602, -4959.356445, 30.031250 ),
- Vector( 7608.576660, -1570.525757, 30.031250 )
- }
- // Set Model and shit..
- function ENT:Initialize()
- self:SetModel("models/props_c17/BriefCase001a.mdl")
- self.Entity:PhysicsInit(SOLID_VPHYSICS)
- self.Entity:SetMoveType(MOVETYPE_NONE)
- self.Entity:SetSolid(SOLID_VPHYSICS)
- self:SetUseType(SIMPLE_USE)
- self.Entity:SetMaterial("models/props_c17/FurnitureMetal001a")
- self.Entity:SetPos( self:GetPos() + Vector( 0, 0, 15 ) )
- self.Entity:GetPhysicsObject():EnableMotion(false)
- end
- function ENT:Use(activator, caller)
- local amount = math.random( 5000, 10000 )
- activator:AddMoney(amount)
- activator:ChatPrint("You have found the dP chest: $"..amount.."!")
- activator:ChatPrint("Made by AC.")
- self.Entity:SetPos( Vector( 7852, -2431, 389 ) )
- timer.Simple( 5, function( )
- self.Entity:Spawn()
- self.Entity:SetPos( table.Random( ChestSpawnPoints ))
- end, self.Entity)
- end
- function ENT:Think( )
- if !ValidEntity(self.Entity) then return end
- self.Pos = (self.Entity:GetPos() + Vector(0,0,100))
- self:SetAngles(self.Entity:GetAngles() + Angle(0, 5 ,0) )
- self:SetPos(self.Entity:GetPos() + Vector(0,0, math.sin( RealTime()*2 )*7))
- self:NextThink(RealTime())
- end
- hook.Add( "InitPostEntity", "SpawnChest", function( )
- local ent = ents.Create("chest")
- ent:SetPos( table.Random( ChestSpawnPoints ) )
- ent:Spawn()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement