Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --@name Kega
- --@author Dick_Inside_Head
- --@shared
- if SERVER then
- function SpawnNewKega()
- random_count = math.random(5,10)
- real_count = 0
- kega = prop.createSent(chip():localToWorld(Vector(0, 0, 20)), chip():localToWorldAngles(Angle(0,0,0)), "sent_soccerball", false)
- kega:setNoDraw( 1 )
- --kega:setUnbreakable( true )
- kegaholo = holograms.create( kega:localToWorld(Vector(0, 0, 0) ) , kega:localToWorldAngles(Angle(0,0,0)), "models/props_junk/garbage_plasticbottle003a.mdl" , Vector( 2.5 , 2.5 , 1.5) )
- kegaholo:setParent( kega )
- kegaholo:setColor( Color(255,200,20,200) )
- kegaholo2 = holograms.create( kega:localToWorld(Vector(0, 0, 16) ) , kega:localToWorldAngles(Angle(0,0,90)), "models/sprops/geometry/fdisc_12.mdl" , Vector( 0.5 , 1 , 0.5) )
- kegaholo2:setParent( kegaholo )
- kegaholo2:setColor( Color(255,255,255,255) )
- kegaholo2 = holograms.create( kega:localToWorld(Vector(0, 0, 1) ) , kega:localToWorldAngles(Angle(0,0,90)), "models/sprops/geometry/fdisc_12.mdl" , Vector( 0.1 , 9 , 0.1 ) )
- kegaholo2:setParent( kegaholo )
- kegaholo2:setColor( Color(255,100,20,150) )
- ThinkForNewKega()
- end
- local kegaPos,kegaSpeed
- function KegaBooom( pos )
- local kegaBoom = prop.create( pos , chip():localToWorldAngles(Angle(0,0,0)), "models/props_phx/cannonball_solid.mdl", false)
- net.start("playSong")
- net.writeVector( pos )
- net.send()
- kegaBoom:setNoDraw( 1 )
- kegaBoom:setSolid( false )
- kegaBoom:breakEnt()
- end
- local nextCount = 2
- function ThinkForNewKega()
- hook.add("think", "checkKegaLife", function()
- if isValid(kega) then
- kegaPos = kega:getPos()
- local forward = kega:localToWorld( Vector(1, 0, 0) ) - kegaPos
- kegaSpeed = kega:getVelocity():dot( forward )
- if timer.curtime() < nextCount then return end
- if kegaSpeed >= 100 then
- nextCount= timer.curtime() + 2
- real_count = real_count + 1
- print( real_count .. "of" .. random_count )
- end
- if real_count == random_count then
- kega:remove()
- end
- else
- KegaBooom( kegaPos ) hook.remove("think", "checkKegaLife")
- end
- end)
- end
- timer.create("Tick", 1,0, function()
- if !isValid(kega) then
- SpawnNewKega()
- end
- end)
- else
- url = "https://cdn.discordapp.com/attachments/828760088062722068/962460669800759387/tailera1-vzorvalo-naxui-kega-kissvkcom_5Is7piR8.mp3"
- vol = 1
- id = Vector(1,1,1)
- local function loadSong(songURL, vector, vols)
- if song then song:stop() end
- bass.loadURL(songURL, "3d noblock", function(snd, err, errtxt)
- if snd then
- song = snd
- snd:setPos( id )
- snd:setFade(500, 1000)
- snd:setVolume(1)
- else
- print(errtxt)
- end
- end)
- --url = nil
- end
- net.receive("playSong", function(len)
- --url = net.readString()
- id = net.readVector()
- --print(id)
- loadSong(url, id, vol)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement