################
# > Discoball: A disco ball.
# > How to use: Spawn it, physgun it into the air and freeze it. It will rotate automatically.
################

@name DiscoBall
@model models/hunter/misc/sphere1x1.mdl
@persist I

interval(50)

if (first()|duped()) {
    entity():setMaterial("models/XQM/LightLinesGB")
    for (I=1,20) {
        holoCreate(I)
        holoModel(I,"hqcone")
        holoAng(I,ang(random(-40,40),random(-40,40),random(-40,40)))
        holoPos(I,holoEntity(I):pos()+holoEntity(I):angles():up()*-300)
        holoScale(I,vec(10,10,50))
        holoAlpha(I,50)
        holoParent(I,entity())
    }
}

for (I=1,20) {
    holoColor(I,vec(random(360),random(360),random(360)))
}

entity():setAng(ang(0,entity():angles():yaw(),0)+ang(0,5,0))
