Scrap Mechanic

Scrap Mechanic

Expanded info
WaspEyeNight  [developer] 2 Feb, 2021 @ 11:44am
Damage indicators with ikey07's character mods
THIS IS BROKEN IN 0.5.0 OR ABOVE. This will get updated soon!

Here is how you can make the damage indicator work with ikey07's character mods:

DUCK CHARACTER & SHARK CHARACTER:
1. Find your Scrap Mechanic workshop folder and open the folder named "2348563014" if you are doing the duck, or "2257881822" if you are doing the shark. After that go into "Scripts"

2. Open the file called "DuckUnit.lua" (Duck) or "SharkUnit.lua" (Shark) with any text editor.

3. At the top of the file, add
if SurvivalGame then dofile "$SURVIVAL_DATA/Scripts/game/SurvivalPlayer.lua" end

4. If you are doing the duck, below
"function DuckUnit.server_onFixedUpdate( self, dt )" add this:
if SurvivalGame then pcall(function() SurvivalPlayer.sv_unitUpdates( self, { "Duck (ikey07)", self.saved.stats.hp, self.saved.stats.maxhp, self.unit.id } ) end ) end
Or if you are doing the shark, below
"function SharkUnit.server_onFixedUpdate( self, dt )" add this:
if SurvivalGame then pcall(function() SurvivalPlayer.sv_unitUpdates( self, { "Shark (ikey07)", self.saved.stats.hp, self.saved.stats.maxhp, self.unit.id } ) end ) end

5. Close to the bottom of the file, below
"if sm.exists( self.unit) and not self.destroyed then" add this if you are doing the duck:
if SurvivalGame then pcall(function() SurvivalPlayer.sv_unitUpdates( self, { "Duck (ikey07)", 0, self.saved.stats.maxhp, self.unit.id } ) end ) end
or this if you are doing the shark:
if SurvivalGame then pcall(function() SurvivalPlayer.sv_unitUpdates( self, { "Shark (ikey07)", 0, self.saved.stats.maxhp, self.unit.id } ) end ) end

6. Make sure to save. After that you are done!
Last edited by WaspEyeNight; 3 Apr, 2021 @ 8:30am