Advertisement
Guest User

Untitled

a guest
Jul 18th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MPASM 2.34 KB | None | 0 0
  1. // Made by AC²
  2. // For dP
  3.  
  4. // Download and load shared.lua
  5. AddCSLuaFile("shared.lua")
  6. --AddCSLuaFile("cl_init.lua")
  7. include("shared.lua")
  8.  
  9. // It has loaded!
  10. MsgN("=====================")
  11. MsgN("[[      Chest      ]]")
  12. MsgN("[[      By AC      ]]")
  13. MsgN("=====================")
  14.  
  15.  
  16. // Random Table
  17. local ChestSpawnPoints = {
  18.  
  19.     Vector( 4701.548828, 1676.690063, 40.031250 ),
  20.     Vector( 1740.472778, -1362.380615, 40.031250 ),
  21.     Vector( -1400.435303, -1595.658936, 40.031250 ),
  22.     Vector( 6715.950195, 2726.604736, 40.031250 ),
  23.     Vector( -13726.212891, 416.761536, -1010.398071 ),
  24.     Vector( -6965.378418, -6382.761230, 72.528206 ),
  25.     Vector( 447.454834, -3545.223633, 45.031250 ),
  26.     Vector( 1667.111816, -5442.578613, 50.031250 ),
  27.     Vector( 3308.397705, -8873.604492, 40.041061 ),
  28.     Vector( 6946.916504, -7970.968750, 30.031250 ),
  29.     Vector( 6506.471680, -5165.207031, 30.031250 ),
  30.     Vector( 10557.391602, -4959.356445, 30.031250 ),
  31.     Vector( 7608.576660, -1570.525757, 30.031250 )
  32. }
  33.  
  34. // Set Model and shit..
  35. function ENT:Initialize()
  36.     self:SetModel("models/props_c17/BriefCase001a.mdl")
  37.     self.Entity:PhysicsInit(SOLID_VPHYSICS)
  38.     self.Entity:SetMoveType(MOVETYPE_NONE)
  39.     self.Entity:SetSolid(SOLID_VPHYSICS)
  40.     self:SetUseType(SIMPLE_USE)
  41.     self.Entity:SetMaterial("models/props_c17/FurnitureMetal001a")
  42.     self.Entity:SetPos( self:GetPos() + Vector( 0, 0, 15 ) )
  43.     self.Entity:GetPhysicsObject():EnableMotion(false)
  44. end
  45.  
  46. function ENT:Use(activator, caller)
  47.     local amount = math.random( 5000, 10000 )
  48.     activator:AddMoney(amount)
  49.     activator:ChatPrint("You have found the dP chest: $"..amount.."!")
  50.     activator:ChatPrint("Made by AC.")
  51.     self.Entity:SetPos( Vector( 7852, -2431, 389 ) )
  52.     timer.Simple( 5, function( )
  53.         self.Entity:Spawn()
  54.         self.Entity:SetPos( table.Random( ChestSpawnPoints ))
  55.     end, self.Entity)
  56. end
  57.  
  58. function ENT:Think( )
  59.     if !ValidEntity(self.Entity) then return end
  60.     self.Pos = (self.Entity:GetPos() + Vector(0,0,100))
  61.     self:SetAngles(self.Entity:GetAngles() + Angle(0, 5 ,0) )
  62.     self:SetPos(self.Entity:GetPos() + Vector(0,0, math.sin( RealTime()*2 )*7))
  63.     self:NextThink(RealTime())
  64. end
  65.  
  66.  
  67. hook.Add( "InitPostEntity", "SpawnChest", function( )
  68.     local ent = ents.Create("chest")
  69.     ent:SetPos( table.Random( ChestSpawnPoints ) )
  70.     ent:Spawn()
  71. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement