- Dependencies
- Copy Paste (Required)
- Works With
This Rust plugin lets players throw special grenades that instantly spawn full prebuilt bases on impact, just like the Port-A-Fort from Fortnite. Using Copy Paste files, you can define multiple grenade types, each with their own builds and fuse times.
Commands
pf.givegrenade <playerNameOrId> <configIndex> [amount]
- Gives amount (default 1)of the selected fort‑grenade to the target player.playerNameOrId
- Full/partial name or Steam ID.configIndex
- Index of the grenade entry in the config.amount
(Optional) - Number of grenades to give.
Configuration
JSON:
{
"Version": "1.7.0",
"Ignore Water Shallower Than This Depth": 1.0,
"Return Grenade If Combat Blocked (Better No Escape)": false,
"Return Grenade If Raid Blocked (Better No Escape)": false,
"Fort Grenades": [
{
"Grenade Skin Id": 1163186435,
"Grenade Display Name": "Port-A-Fort",
"Fuse Length Seconds": 10.0,
"Paste Files": [
{
"Filename": "StarterBase",
"Override Entity Ownership To Throwing Player": true,
"Override Building Grade": "None",
"Raise Building By This Amount": 2.3,
"Paste Options": {
"stability": "false",
"deployables": "true"
}
},
{
"Filename": "TrapBase",
"Override Entity Ownership To Throwing Player": false,
"Override Building Grade": "Twigs",
"Raise Building By This Amount": 2.8,
"Paste Options": {
"stability": "false",
"blockcollision": "0"
}
},
{
"Filename": "FurnaceBase",
"Override Entity Ownership To Throwing Player": true,
"Override Building Grade": "Wood",
"Raise Building By This Amount": 1.8,
"Paste Options": {
"stability": "true",
"deployables": "true",
"inventories": "true"
}
}
]
},
{
"Grenade Skin Id": 815252048,
"Grenade Display Name": "Port-A-Fort 2",
"Fuse Length Seconds": 5.0,
"Paste Files": [
{
"Filename": "HeliTower",
"Override Entity Ownership To Throwing Player": true,
"Override Building Grade": "Stone",
"Raise Building By This Amount": 2.5,
"Paste Options": {
"stability": "true",
"auth": "false"
}
},
{
"Filename": "RaidCamp",
"Override Entity Ownership To Throwing Player": false,
"Override Building Grade": "Metal",
"Raise Building By This Amount": 3.2,
"Paste Options": {
"stability": "true",
"deployables": "true",
"inventories": "true"
}
}
]
}
]
}
Ignore Water Shallower Than This Depth
- Fort placement is blocked only if the water at the impact point is deeper than this value (in metres). Lets you allow building in puddles and shallow rivers while still preventing ocean drops.Return Grenade If Combat Blocked
- If Better No Escape says the thrower is combat-blocked, the fort won't spawn and the grenade is instantly given back to them.Return Grenade If Raid Blocked
- Same, but triggered when the thrower is raid-blocked instead of combat-blocked.Fort Grenades
- A list of grenade definitions that can spawn forts when thrown.Grenade Skin Id
- The skin id of the grenade item to match. If you want to use the default grenade (no skin), set this to 0.Grenade Display Name
- Optional custom name to further identify the grenade. Leave this empty to match any name (just relies on the skin id).Fuse Length Seconds
- Time in seconds before the fort spawns after the grenade lands.Paste Files
- A list of Copy Paste file names the plugin will randomly pick from when this grenade is used.
Filename
- The name of the Copy Paste file to load (do not include.json
extension).Override Entity Ownership To Throwing Player
- If true, the pasted base will belong to the grenade thrower (they can authorize on TC, open doors, etc.). If false, ownership is unchanged and defaults to nobody.Override Building Grade
- Forces all blocks in the pasted base to this building grade.
Available values:None
- Keep the grade saved in the paste fileTwigs
Wood
Stone
Metal
TopTier
Raise Building By This Amount
- How much to raise the base above the ground (in meters). Use reasonable values:- A value too high can make the base float.
- A negative value can bury it below the terrain.
Paste Options
- Optional CopyPaste options to control how the base is pasted.
Supported keys include:stability
- Whether to apply building stability (true or false)deployables
- Include deployable items (true or false)auth
- Automatically authorize the thrower on cupboards (true or false)inventories
- Load saved container contents (true or false)
autoheight
is always falseblockcollision
is always 0
Localization
JSON:
{
"GiveGrenade.Usage": "Usage: pf.givegrenade <playerNameOrId> <configIndex> [amount]",
"GiveGrenade.IndexInvalid": "Invalid configIndex '{0}'. It must be a number.",
"GiveGrenade.NoConfigFound": "No grenade config found at index {0}.",
"GiveGrenade.NoPlayerFound": "No active player found matching '{0}'.",
"GiveGrenade.FailedCreate": "Failed to create grenade.f1 item!",
"GiveGrenade.Success": "Gave '{0}' grenade (index {1}) x{2} to player {3}.",
"Grenade.Refund": "Couldn't place the fort: {0}\nYour grenade has been returned!"
}
Developer Hooks
C#:
object OnFortDeploy(BasePlayer player, TimedExplosive grenade, string pasteFile)
player
- The player who threw the grenade.grenade
- TheTimedExplosive
entity that is about to trigger the paste.pasteFile
- The name of the CopyPaste file the plugin intends to paste.- Return values:
false
- Cancel the deployment and refund the grenade.string
- Cancel the deployment and show the returned string as the refund reason.Dictionary<string,string>
- If it contains a key "PasteFile", the value replaces the file that will be pasted; any other return is ignored.
C#:
void OnFortFinishedPasting(BasePlayer player, List<BaseEntity> entities)
player
- The owner of the new fort.entities
- A completeList<BaseEntity>
representing every entity that was spawned for this fort.