Skip to content

Commit 493ca94

Browse files
authored
Code clean-up
1 parent 6ecdaeb commit 493ca94

4 files changed

Lines changed: 4 additions & 13 deletions

File tree

src/Buffer.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
local Types = require(script.Parent.Types)
2-
31
local CollectionService = game:GetService("CollectionService")
42
local RunService = game:GetService("RunService")
53
local Players = game:GetService("Players")
@@ -359,7 +357,7 @@ function Export:AddItem(item: Instance)
359357

360358
local currentPlayer = self:GetCurrentPlayer()
361359

362-
-- Pick a position to store the projectile in. This should be far away from the playable area.
360+
-- Store projectile outside of play area to prevent it from being visible.
363361
local lockPosition = Vector3.new(randomGen:NextInteger(-10^2, 10^2), 100000 - randomGen:NextInteger(0, 100), randomGen:NextInteger(-10^2, 10^2))
364362
item:PivotTo(CFrame.new(lockPosition))
365363

@@ -384,10 +382,9 @@ function Export:AddItem(item: Instance)
384382
end
385383
item:SetAttribute("_bufferOrder", self._bufferOrder)
386384

387-
-- Parent the item to the buffer.
388385
item.Parent = self.itemContainer
389386

390-
-- Set ownership after the item is parented.
387+
-- Set ownership after the item is parented to prevent errors.
391388
if primaryPart:CanSetNetworkOwnership() then
392389
primaryPart:SetNetworkOwner(currentPlayer)
393390
end

src/BufferClient.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ local Buffer = require(script.Parent.Buffer)
88
local LOCAL_PLAYER = Players.LocalPlayer
99
local ENABLE_LOCAL_COLLISIONS = Configuration.ENABLE_LOCAL_COLLISIONS
1010
local HIDE_UNPOPPED_ITEMS = Configuration.HIDE_UNPOPPED_ITEMS
11-
local STREAMING_COMPATIBILITY = workspace.StreamingEnabled and Configuration.STREAMING_ENABLED_COMPATIBILITY
1211
local PROJECTILE_TAG = "BufferItem"
1312
local REFERENCE_TAG = "BufferReference"
1413
local TOOL_TAG = "BufferTool"

src/BufferModule.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
-- Virshal (Roblox @metaVirshal), 2022
22
-- github/Virshal/BufferModule
33

4-
local Types = require(script:WaitForChild("Types"))
5-
64
local RunService = game:GetService("RunService")
75

86
local Configuration = require(script:WaitForChild("Configuration"))

src/Configuration.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
return {
22
BUFFER_FOLDER_NAME = "BufferedItems";
33
-- - The name of the folder that will store items in the buffer.
4-
54
HIDE_UNPOPPED_ITEMS = true;
65
-- (Security setting)
76
-- - Hides unpopped items in buffers that aren't owned by the local player by storing the buffers in nil.
8-
97
BUFFER_DISABLE_CAN_TOUCH = true;
108
-- (Security setting)
119
-- - If true, items in the buffer will not fire touch events until popped.
1210

13-
14-
11+
1512
-- [EXPERIMENTAL]
16-
13+
-- Experimental settings may cause stability issues.
1714
ENABLE_LOCAL_COLLISIONS = false;
1815
-- (Security setting)
1916
-- - If true, any Parts in a buffer with the Attribute/CollectionService tag "LocalCollisions" will only be able to push around

0 commit comments

Comments
 (0)