Working on my own cloaking system for my gamemode and i cant figure out how i could make the viewmodel's arms ( not just the gun ), change material and alpha/color. Also having this problem with the world model. Anyone got any ideas or insight on what functions to use? Thanks in advance
[url]http://wiki.garrysmod.com/page/GM/PreDrawPlayerHands[/url]
[url]http://wiki.garrysmod.com/page/GM/PostDrawPlayerHands[/url]
The functions are all the same.
[QUOTE=Robotboy655;48945020][url]http://wiki.garrysmod.com/page/GM/PreDrawPlayerHands[/url]
[url]http://wiki.garrysmod.com/page/GM/PostDrawPlayerHands[/url]
The functions are all the same.[/QUOTE]
Oh i was using
[CODE]LocalPlayer():GetViewModel():SetMaterial("models/effects/comball_sphere")
LocalPlayer():GetViewModel():SetColor(Color(0, 0, 0,0))
[/CODE]
thanks for shwoing me these functions :3
solved that issue but now what about the world models
--Edit
Alright so those functions you gave me arent doing what i thought they did, im trying to set the entitys materials and colors like i did above but its not working
[CODE] hook.Add("PostDrawPlayerHands","cloakingViewModel", function(hands,vm,ply,wep)
if(ply:GetNWBool("cloakingEnabled"))then
if(ply:GetNWBool("cloakingEnabledFlash"))then
hands:SetMaterial("models/effects/comball_sphere")
hands:SetColor(Color(255, 255, 255,255))
vm:SetMaterial("models/effects/comball_sphere")
vm:SetColor(Color(255, 255, 255,255))
else
hands:SetMaterial("models/effects/comball_sphere")
hands:SetColor(Color(0, 0, 0,0))
vm:SetMaterial("models/effects/comball_sphere")
vm:SetColor(Color(0, 0, 0,0))
end
else
hands:SetColor(Color(255, 255, 255,255))
hands:SetMaterial(nil)
vm:SetColor(Color(255, 255, 255,255))
vm:SetMaterial(nil)
end
end)[/CODE]
Sorry, you need to Log In to post a reply to this thread.