Skip to content

Commit f85f2c2

Browse files
committed
Commit files.
1 parent a894157 commit f85f2c2

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

player_blood/.assets/thumb.jpg

278 KB
Loading

player_blood/addon.kv3

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!-- kv3 encoding:text:version{e21c7f3c-8a33-41c5-9977-a76d3a32aa0d} format:generic:version{7412167c-06e9-4698-aff2-e63eb59037e7} -->
2+
{
3+
mod = "Player Blood (★)"
4+
description = "Re-enables player blood, as seen in Portal 1.\n\nVersion 1.0.0"
5+
type = ""
6+
id = 0
7+
thumbnail = ".assets/thumb.jpg"
8+
authors =
9+
[
10+
"P2:CE Team",
11+
]
12+
dependencies = [ ]
13+
tags = [ ]
14+
ignore = [ ]
15+
metadata =
16+
{
17+
}
18+
assets =
19+
{
20+
}
21+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// sv_init.nut runs before entities have spawned + on every game load. wait until entities are ready before running
2+
function initStart() {
3+
local initStartTimer = CreateEntityByName("logic_timer", { // check every tick if entities have actually spawned in yet
4+
targetname = "playerblood_canstarttimer"
5+
RefireTime = 0.01
6+
})
7+
8+
initStartTimer.ConnectOutput("OnTimer", "Init")
9+
EntFire("playerblood_canstarttimer", "Enable")
10+
}
11+
function Init() { // if player exists, other entities exist
12+
local player = GetPlayer()
13+
if(player != null) {
14+
EntFire("playerblood_canstarttimer", "Kill") // prevent further inits
15+
16+
player.__KeyValueFromString("bloodcolor", "0") // enable blood
17+
if(GetDeveloperLevel() > 0) printl("[PLAYER BLOOD - DEV] Enabled player blood.")
18+
}
19+
}
20+
21+
// run the script
22+
initStart()

0 commit comments

Comments
 (0)