Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Material Changer
- @inputs
- @outputs
- @persist Used1
- @persist Used2
- @persist Materials:array
- @model models/props_combine/breenglobe.mdl
- runOnKeys(owner(),1)
- if (first()) {
- }
- if (owner():weapon():type() == "weapon_crowbar") {
- if (keyClk() & owner():keyAttack1() & !Used1) {
- Used1 = 1
- # change material
- Prop = owner():aimEntity()
- if (Materials:count() != 0) {
- # Prop:setMaterial(Materials:string(1))
- foreach(K,V:string=Materials) {
- Prop:setSubMaterial(K,V)
- }
- }
- } elseif (keyClk() & !owner():keyAttack1()) {
- Used1 = 0
- }
- if (keyClk() & owner():keyAttack2() & !Used2) {
- Used2 = 1
- # pick up material
- Prop = owner():aimEntity()
- if (Prop) {
- Materials = Prop ? Prop:getMaterials() : Materials
- print("Picked up:",Prop:type())
- }
- } elseif (keyClk() & !owner():keyAttack2()) {
- Used2 = 0
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement