Results 1 to 7 of 7
  1. #1
    script kiddy's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Location
    Uganda
    Posts
    35
    Reputation
    10
    Thanks
    4
    My Mood
    Bashful

    Question v:SetMaterial HELP

    So im trying to make a models/wireframe and models/debug/debugwhite mix up. Like the wireframe would be blue and debug woule be white, idk i just think it looks nice.

    Anyways, I tried render.setmaterialoverride and v:SetMaterial but i can only set one material. How do i set 2 materials?

    Im kinda going for falcos smalls scripts chams kinda lookalike.



    Heres a picture of it. Its an attatchment.

    Please dont come in here to post shittalk.


    Attached Thumbnails Attached Thumbnails
    maxresdefault.jpg  

    Last edited by Hunter; 01-17-2016 at 09:29 AM.

  2. The Following User Says Thank You to script kiddy For This Useful Post:

    RabidRunner (12-23-2015)

  3. #2
    Smoke's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    11,899
    Reputation
    2661
    Thanks
    4,610
    My Mood
    Amazed
    Moved to the correct section.


    CLICK TO BUY NOW!!


    Quote Originally Posted by Liz View Post
    This is my first vouch, ever. Rapidgator account worked perfectly. Would buy in the future.

  4. The Following User Says Thank You to Smoke For This Useful Post:

    script kiddy (12-23-2015)

  5. #3
    0 - p100 real quick's Avatar
    Join Date
    Sep 2015
    Gender
    female
    Posts
    19
    Reputation
    10
    Thanks
    503
    You'd have to edit the material itself i.e. changing debugwhite or the wireframe material.

  6. #4
    eth0s's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    1,887
    Code:
    local debugWhite = Material("models/debug/debugwhite")
    local wireFrame = Material("models/wireframe")
    local function playerChams(player)
    	cam.Start3D()
    	render.SuppressEngineLighting(false)
    	render.SetColorModulation(1, 0, 0)
    	render.MaterialOverride(debugWhite)
    	cam.IgnoreZ(true)
    	player:DrawModel()
    	render.SetColorModulation(0, 0, 1)
    	render.MaterialOverride(wireFrame)
    	player:DrawModel()
    	cam.IgnoreZ(false)
    	render.SetColorModulation(0, 0, 0)
    	render.SuppressEngineLighting(true)
    	cam.End3D()
    end
    
    local function RenderScreenspaceEffects()
    	local everyPlayer = player.GetAll()
    	for i = 1, #everyPlayer do
    		local player = everyPlayer[i]
    		
    		if (player == nil) then
    			continue 
    		end
    		
    		if (!IsValid(player)) then
    			continue
    		end
    		
    		if (player:IsDormant()) then
    			continue
    		end
    		
    		playerChams(player)
    	end
    end
    
    hook.Add("RenderScreenspaceEffects", "", RenderScreenspaceEffects)
    this works fine, remember to cache the materials before using them
    Last edited by eth0s; 12-24-2015 at 07:07 AM.

  7. The Following User Says Thank You to eth0s For This Useful Post:

    Keepo123 (12-23-2015)

  8. #5
    D3M0L1T10N's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    1,364
    Reputation
    19
    Thanks
    656
    Quote Originally Posted by eth0s View Post
    Code:
    local function playerChams(player)
    	cam.Start3D()
    	render.SuppressEngineLighting(false)
    	render.SetColorModulation(1, 0, 0)
    	render.MaterialOverride(Material("models/debug/debugwhite"))
    	cam.IgnoreZ(true)
    	player:DrawModel()
    	render.SetColorModulation(0, 0, 1)
    	render.MaterialOverride(Material("models/wireframe"))
    	player:DrawModel()
    	cam.IgnoreZ(false)
    	render.SetColorModulation(0, 0, 0)
    	render.SuppressEngineLighting(true)
    	cam.End3D()
    end
    
    local function RenderScreenspaceEffects()
    	local everyPlayer = player.GetAll()
    	for i = 1, #everyPlayer do
    		local player = everyPlayer[i]
    		
    		if (player == nil) then
    			continue 
    		end
    		
    		if (!IsValid(player)) then
    			continue
    		end
    		
    		if (player:IsDormant()) then
    			continue
    		end
    		
    		playerChams(player)
    	end
    end
    
    hook.Add("RenderScreenspaceEffects", "", RenderScreenspaceEffects)
    this works fine, remember to cache the materials before using them
    tells him to cache the materials but doesn't show in his code

    why
    8:53 PM - Xenomorphic 1 hr 7 min cooldown: So is MPGH only exist so people can c+p from ************* and troll the gmod section?

    [IMG]https://i739.photobucke*****m/albums/xx38/jorroa5990/flatexch2_zpsec96a7e2.gif[/IMG]

  9. #6
    script kiddy's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Location
    Uganda
    Posts
    35
    Reputation
    10
    Thanks
    4
    My Mood
    Bashful
    thanks for the help!

  10. #7
    Smoke's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    11,899
    Reputation
    2661
    Thanks
    4,610
    My Mood
    Amazed
    Seems this has been solved.

    /Closed.


    CLICK TO BUY NOW!!


    Quote Originally Posted by Liz View Post
    This is my first vouch, ever. Rapidgator account worked perfectly. Would buy in the future.

Similar Threads

  1. [Help Request] Combat arms Vid help
    By djw111 in forum Combat Arms Help
    Replies: 4
    Last Post: 12-24-2011, 05:06 PM
  2. [Help Request] AFK Bot [help]
    By fet in forum Combat Arms Help
    Replies: 7
    Last Post: 04-28-2011, 03:17 AM
  3. [Help Request] Injector Admin help
    By asdfgas in forum Combat Arms Help
    Replies: 4
    Last Post: 04-27-2011, 06:12 PM
  4. [Help Request] Ajuda / Help
    By - Battery' in forum Combat Arms BR Coding Help
    Replies: 3
    Last Post: 04-22-2011, 07:15 PM
  5. [Help Request] Help my!
    By Windowns7 in forum Combat Arms BR Coding Help
    Replies: 2
    Last Post: 04-18-2011, 01:41 PM