[QUOTE=leiftiger;25894030]You could use COLLISION_GROUP_WORLD, that will make the entity only collide with world
[lua]
function REQPhysgunPickup(ply, ent)
if !ent:IsValid() then return false end
ent:SetColor(255,255,255,150)
ent.OldColGroup = ent:GetCollisionGroup()
ent:SetCollisionGroup(COLLISION_GROUP_WORLD)
end
function REQPhysgunDrop(ply, ent)
if !ent:IsValid() then return false end
ent:SetColor(255,255,255,255)
if ent.OldColGroup then
ent:SetCollisionGroup(ent.OldColGroup)
end
end
hook.Add( "PhysgunPickup", "REQPhysgunPickup", REQPhysgunPickup)
hook.Add( "PhysgunDrop", "REQPhysgunDrop", REQPhysgunDrop)[/lua][/QUOTE]
Works, thanks alot.
Rated myself -.-
WAIT!
How do you make the effect say last for 3 seconds?
LOL, enjoy the gaybow.
What I want to do is make it not collide with other props, but collide with everything else...any ideas?
There's COLLISION_GROUP_INTERACTIVE_DEBRIS or something similiar. (I've never used it but it sounds like it does what you describe)
[QUOTE=Banana Lord.;25894235]LOL, enjoy the gaybow.
What I want to do is make it not collide with other props, but collide with everything else...any ideas?[/QUOTE]
[url]http://wiki.garrysmod.com/?title=Collision_group[/url]
<3
Anyone know how to add a timer? Say, 2 seconds than un-nocollide?
[lua]function REQPhysgunDrop(ply, ent)
if !ent:IsValid() then return false end
ent:SetColor(255,255,255,255)
if ent.OldColGroup then
timer.Simple(2, function()
ent:SetCollisionGroup(ent.OldColGroup)
end)
end
end
hook.Add( "PhysgunDrop", "REQPhysgunDrop", REQPhysgunDrop)[/lua]
[code]
function REQPhysgunDrop(ply, ent)
if !ent:IsValid() then return false end
ent:SetColor(255,255,255,255)
if ent.OldColGroup then
timer.Simple(2, function(REQPhysgunDrop)
ent:SetCollisionGroup(ent.OldColGroup)
end)
end
end
hook.Add( "PhysgunDrop", "REQPhysgunDrop", REQPhysgunDrop)
[/code]
Wouldn't it be that?
Just tested it, code works. It stays no-collided for 2 seconds, then switches to collide.
[QUOTE=Jaastin;25894213]Works, thanks alot.
Rated myself -.-
WAIT!
How do you make the effect say last for 3 seconds?[/QUOTE]
[lua]function REQPhysgunPickup(ply, ent)
if !ent:IsValid() then return false end
ent:SetColor(255,255,255,155)
ent.OldColGroup = ent:GetCollisionGroup()
ent:SetCollisionGroup(COLLISION_GROUP_WORLD)
end
function REQPhysgunDrop(ply, ent)
local timeaa = 0
local x = 1 // set it to the number of seconds you want the fade to be
timer.Create("timeraa", x/10, x*10, function()
if !ent:IsValid() then return false end
timeaa = timeaa + x/10
ent:SetColor(255,255,255,(155 + (100 * (timeaa/x))))
end)
if ent.OldColGroup then
timer.Simple(x, function()
ent:SetCollisionGroup(ent.OldColGroup)
end)
end
end
hook.Add( "PhysgunPickup", "REQPhysgunPickup", REQPhysgunPickup)
hook.Add( "PhysgunDrop", "REQPhysgunDrop", REQPhysgunDrop)[/lua]
combining what banana lord did, and adding alpha fading, change "1" to the number of seconds you want it to fade and stay nocollided for
[code]
function GEntityTakeDamage( ent, inflictor, attacker, amount, dmginfo )
if inflictor:GetClass() == "prop_physics" then
dmginfo:ScaleDamage(0)
end
end
hook.Add("EntityTakeDamage","NoPropDmg",GEntityTakeDamage)
[/code]
Add that for no prop damage if they let go of the prop, no prop killing ftw
[QUOTE=foxxeh;25895751]function GEntityTakeDamage( ent, inflictor, attacker, amount, dmginfo )
if inflictor:GetClass() == "prop_physics" then
dmginfo:ScaleDamage(0)
end
end
hook.Add("EntityTakeDamage","NoPropDmg",GEntityTakeDamage)
Add that for no prop damage if they let go of the prop, no prop killing ftw[/QUOTE]
I tried ScaleDamage (0) once, didn't work, had to make it -1
Uh this ghost's players.
[QUOTE=Zephilinox;25895812]I tried ScaleDamage (0) once, didn't work, had to make it -1[/QUOTE]
It works.. I tested it
[QUOTE=Jaastin;25897268]Uh this ghost's players.[/QUOTE]
What?
[QUOTE=Jaastin;25897268]Uh this ghost's players.[/QUOTE]
Oh, I see, the entity checks got removed...
[lua]
function REQPhysgunPickup(ply, ent)
if !ent:IsValid() or ent:IsPlayer() or ent:IsBot() or ent:IsWorld() or ent:IsNPC() then return false end
ent:SetColor(255,255,255,155)
ent.OldColGroup = ent:GetCollisionGroup()
ent:SetCollisionGroup(COLLISION_GROUP_WORLD)
end
function REQPhysgunDrop(ply, ent)
local timeaa = 0
local x = 1 // set it to the number of seconds you want the fade to be
timer.Create("timeraa", x/10, x*10, function()
if !ent:IsValid() or ent:IsPlayer() or ent:IsBot or ent:IsWorld or ent:IsNPC() then return false end
timeaa = timeaa + x/10
ent:SetColor(255,255,255,(155 + (100 * (timeaa/x))))
end)
if ent.OldColGroup then
timer.Simple(x, function()
ent:SetCollisionGroup(ent.OldColGroup)
end)
end
end
hook.Add( "PhysgunPickup", "REQPhysgunPickup", REQPhysgunPickup)
hook.Add( "PhysgunDrop", "REQPhysgunDrop", REQPhysgunDrop)
[/lua]
Wow GreaseMonkey was right, none of you can use the wiki, you all need tobe spoon fed.
[QUOTE=notRzilla;25913821]Wow GreaseMonkey was right, none of you can use the wiki, you all need tobe spoon fed.[/QUOTE]
Anyone with internet can use the wiki.
I prefer eating with forks, unless its soup.
[QUOTE=notRzilla;25913821]Wow GreaseMonkey was right, none of you can use the wiki, you all need tobe spoon fed.[/QUOTE]
We run servers, do we look like we have a million hours to bother with something like that?
Yes, learning is obviously the best way, but if you have players minging like mad, you don't have much time to fix it.
@zeph, thanks for the script .
[QUOTE=Jaastin;25917264]We run servers, do we look like we have a million hours to bother with something like that?
Yes, learning is obviously the best way, but if you have players minging like mad, you don't have much time to fix it.
@zeph, thanks for the script .[/QUOTE]
Sorry but that is the shittest excuse I've ever heard... I run 2 servers and do my own lua coding for them, they're fine.
[QUOTE=foxxeh;25919283]Sorry but that is the shittest excuse I've ever heard... I run 2 servers and do my own lua coding for them, they're fine.[/QUOTE]
Shitty excuse or not I don't have the time :3
If you don't have the time quit GMod.
Your facist.
:(
People don't have time for things liek disssss manz.
It's too complicated and im very lazy.
Oh btw, your picture makes me think you look like him. And I laugh everytime =/
Sorry to be mean though :(
Sorry, you need to Log In to post a reply to this thread.