DropletServerManager
Functions
RegisterResourceType
Registers a new resource type. Attempting to register a resource type with the same name as an existing one will error. Resource types define how droplets of that type behave on the server and client. The same table must be registered to the same name on both server and client.
local data = require(path.to.ExampleResourceTypeData) -- There is an Example file included in the package you can check out.
DropletServerManager:RegisterResourceType("Example", data)
GetResourceTypeData
Returns the data that was provided for a given registered resource type.
Spawn
DropletServerManager:Spawn() → number--
The seed of the droplet request.
Creates a new droplet request to create some defined number of droplets of a given ResourceType. The droplet request will be created on the server and replicated to the clients.
A PlayerTargets array can be passed to specify which players the droplet request should be replicated to, if one isnt given it replicates to all connected players at the moment of the request.
Caveats
Some properties of the interface have special behaviors depending on their type. See 'ResourceSpawnData' for more info on important caveats and behavior.
local Bounds = 35
local seed = DropletServerManager:Spawn({
ResourceType = "Example";
Value = NumberRange.new(0.6, 1.4);
Count = NumberRange.new(2, 10);
LifeTime = NumberRange.new(10, 20);
SpawnLocation = Vector3.new(
math.random(-Bounds,Bounds),
7,
math.random(-Bounds,Bounds)
);
CollectorMode = "MultiCollector";
})
Claim
DropletServerManager:Claim(seed: number,--
The droplet request identifier.
dropletNumber: number?--
The particular droplet number to claim. If nil, all remaining droplets will be claimed.
) → boolean--
Whether or not the claim was successful.
Force claim a droplet(s) for a player.
Collect
DropletServerManager:Collect(seed: number,--
The droplet request identifier.
dropletNumber: number?--
The particular droplet number to collect. If nil, all droplets will be collected.
) → boolean--
Whether or not the collection was successful.
Force collects a droplet(s) resource and returns whether or not the collection was successful.