19 lines
433 B
GDScript
19 lines
433 B
GDScript
class_name FuseBox
|
|
extends StaticBody3D
|
|
|
|
var done: bool = false
|
|
|
|
func _ready() -> void:
|
|
if multiplayer.is_server():
|
|
Multiplayer.fuseboxes += 1
|
|
|
|
func _on_fixing_started(body: Node3D) -> void:
|
|
if multiplayer.is_server() and !done and body is Player:
|
|
var player: Player = body
|
|
if !player.hunter:
|
|
complete_fusebox()
|
|
|
|
func complete_fusebox() -> void:
|
|
($Hinge as Node3D).rotation.y = 0
|
|
done = true
|
|
Multiplayer.fuseboxes -= 1
|