Question 1:
I am just confused on how to make a grenade target a player. I am ring to make a grenade, to where I can use "ply:SetModelScale()". I just have no clue how to make it target a player.
Question 2:
I just wanted to know if this was a good way to code something to remove a entity.
[code] hook.Add("PlayerSpawn","Remover",function(ply)
e:RemoveEffects(EF_BONEMERGE)
e:Remove()
hook.Remove( "PlayerSpawn", "Remover" )
end)[/code]
Now someone helped me in a past post, with making a gun target a certain player, but I am still confused with hooks and stuff. I only understand bits and pieces about it. Like if you have a function and it has "(ply,)" after it, what does that exactly do. Is that defining the player that can be targeted?
Q1: You need to specify an explode hook/func if you don't already have one, and go through the list of players in the specified explosion radius from their distance to point of explosion of the grenade. For each player that falls into the radius, you can adjust their SetModelScale.
Q2: The bit in the brackets are the args of the function that are passed on from the hook. In the case of PlayerSpawn, it is indeed the player who has just spawned, and you can act upon them.
Sorry, you need to Log In to post a reply to this thread.