• Change Player's Blood Color
    7 replies, posted
I saw this BLOOD_COLOR Enumerations and thought it would be neat to have an item change a player's blood color - doesn't seem to work though. It's for the nanites health pickup I made. I figured it have the player spark instead of bleed. After I touch the item I get healed like normal but damage causes normal red blood still. Any help would be appreciated. I added the line 'activator:SetBloodColor(BLOOD_COLOR_MECH)' to try and change the blood of the activator (player). function ENT:StartTouch( activator, ent ) --check to see if the round is active before a player can pick this item up if GetRoundState() == ROUND_ACTIVE then  --check if the activator is a player if ( activator:IsPlayer() ) then  --if the player is at 150 or higher health do not let them use the nanites if ( activator:Health() >= 150 ) then return end             --if healing would raise health above 150, set it to 150 if ( activator:Health() > 150 - healthamount ) then activator:SetHealth( 150 ) else --give the player the value of healthamount added to their current health activator:SetHealth( activator:Health() + healthamount ) end --play sound upon using the nanites activator:EmitSound("nanites/nanites.wav", 50, 100) --change players blood color, doesn't currently work - supposed to make sparks when players get shot rather than bleed their own blood activator:SetBloodColor(BLOOD_COLOR_MECH) --make the nanites disappear if a player uses them self.Entity:Remove() end else --if the round hasn't begun or is over, display this chat message activator:ChatPrint( 'We are sorry, Nautilus Microhealth Systemsâ„¢ Healing Nanites may only be used during the round.' ) end end
A long shot but try the number value of "BLOOD_COLOR_MECH" enum like activator:SetBloodColor(3)
It definitely works in my tests, it killing the player will reset their blood color.
Hey thanks, still same. No difference.
Ok. So i made some tests in ttt and this is what I've got. Fall damage is not qualified. It doesn't "drop" blood by normal means. It makes you bleed which "drops" blood without changing it. You need to change the gamemode code for that. (NOTE: My code is the same as yours) https://files.facepunch.com/forum/upload/469093/a457c1fa-4f59-4dce-b42f-03b53de0378a/image.png
Oh god damnit. Figures you gotta get shot. Well that's good. I mean that's just how I wanted it to work anyway. I shoulda tested with some bots. How'd you get them to take the nanites? My code checks if its a player. I assumed if it's not a player it wouldn't work. Or do bots count as players? Thanks for taking the time to test it out.
Are you making a china-friendly version of gmod ?
lol no, but ben stiller said that nobody makes him bleed his own blood so I figured I wanted to be tough like him
Sorry, you need to Log In to post a reply to this thread.