Limiting Weapon use in zone
Posted: Wed Jan 27, 2016 4:35 am
Im working on some scripts for a modified version of Factorio to use in schools and holiday programs. The next step is to be able to define zones in the control.lua for a scenario in which the players are not allowed to fire weapons, activate capsules/grenades, or drive vehicles.
Stopping players from driving inside an area is trivial using the teleport function but the weapon removal/disable is a bit trickier.
My first ideas were:
When players enter these zones strip them of the items and then return them upon leaving the area
or
Remove the equipped slots from players inside the areas
or
replace weapons with "dummy versions when entering zones, and replace them again when leaving zones
Is there a way to intercept the fire keypress or capsule deployment?
How can I store confiscated items that persists across loads/server restarts?
Can anyone think of a better way to do this?
Stopping players from driving inside an area is trivial using the teleport function but the weapon removal/disable is a bit trickier.
My first ideas were:
When players enter these zones strip them of the items and then return them upon leaving the area
or
Remove the equipped slots from players inside the areas
or
replace weapons with "dummy versions when entering zones, and replace them again when leaving zones
Is there a way to intercept the fire keypress or capsule deployment?
How can I store confiscated items that persists across loads/server restarts?
Can anyone think of a better way to do this?