Advertisement
1m1m0

Blackhole v5.0 Prototype

Apr 28th, 2024 (edited)
155
0
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.33 KB | Source Code | 0 0
  1. -- [ Blackhole 5.0 Source Code Prototype ] --
  2. -- Integrated smoother graviational forces for stable simulations.
  3. -- Archived versions - visit my pastebin: https://pastebin.com/u/1m1m0
  4.  
  5. local hole = script.Parent --                       Quick Documentation, more at 「Documentation」
  6. local gravitationalConstant = 1000                  -- Adjust this value to control the strength of the attraction [1000 is default for a black hole]
  7. local updateInterval = 0                            -- Time in seconds between updates while computing (Higher = +Accuracy -Performance, Lower = -Accuracy +Performance)
  8. local damping = 0.7                                 -- Adjust this value to control the rate of force application [1 is no damping, 0.7 is a suggested starting point]
  9. local rangeFactor = 500                             -- Maximum range for objects to be effected [500 studs is default]
  10. local transparencySteps = {0.25, 0.5, 0.75}         -- Transparency changes. (Appearing to fade out of reality)
  11. local dematerializeDuration = 0.01                  -- How long (seconds) the fading will last (In seconds) on each transparency increment
  12. local sizeProportion = 50                           -- Smaller = faster growth for each absorption
  13. local rangeProportion = 125                         -- Bigger = faster range growth
  14. local partColor = BrickColor.new(0)                 -- Color it changes into before getting deleted. (White is default)
  15. local partMaterialTransform = Enum.Material.Neon    -- Material it changes into before getting deleted. (Neon is default)
  16. local absorption = true                             -- Absorb objects that touch the blackhole
  17. local growth = true                                 -- Allow the blackhole to grow by absorption
  18. local killPlayers = true                            -- Kill players that touch the blackhole
  19. local collision = false                             -- Make objects pass through eachother while being absorbed
  20. local fixedPosition = true                          -- Anchor objects while being absorbed (Better FPS)
  21. local toggleMicroGravity = true                     -- This script works best in zero gravity environments! (Optional)
  22.  
  23. -- GRAVITATIONAL FORCES --
  24.  
  25. local lastUpdateTime = 0
  26.  
  27. local function ApplyGravity(object)
  28.  
  29.     -- Delay to pause calculations for better FPS
  30.     local currentTime = tick()
  31.     if currentTime - lastUpdateTime < updateInterval then return end
  32.     lastUpdateTime = currentTime
  33.  
  34.     -- Main bulk of gravitational forces
  35.     local direction = hole.Position - object.Position
  36.     local distance = direction.Magnitude
  37.     -- ---Dont touch, this formula has been tweaked for exact range of effectiveness!--- --
  38.     local distanceSquared = (distance/((rangeFactor/100) + ((rangeFactor/100)*(1/64)))) ^ 2
  39.     -- --------------------------------------------------------------------------------- --
  40.     local magnitude = gravitationalConstant / distanceSquared
  41.     local force = direction.Unit * magnitude * object:GetMass()
  42.  
  43.     local bodyForce = object:FindFirstChild("BlackHoleBodyForce")
  44.     if not bodyForce then
  45.         bodyForce = Instance.new("BodyForce")
  46.         bodyForce.Name = "BlackHoleBodyForce"
  47.         bodyForce.Force = Vector3.new(0, 0, 0)
  48.         bodyForce.Parent = object
  49.     end
  50.  
  51.     -- Apply damping to the force to prevent instability
  52.     bodyForce.Force = (bodyForce.Force + force) * damping
  53. end
  54.  
  55. -- MAIN GRAVITATIONAL FORCE COMPUTER (Applies gravity to anything) --
  56.  
  57. local function CheckAndApplyGravity(obj)
  58.     -- Check if the object is a descendant of a BasePart (including all physical objects)
  59.     if not obj:IsDescendantOf(game.Workspace) or not obj:IsA("BasePart") then
  60.         return
  61.     end
  62.  
  63.     -- Exclude the black hole itself and players from gravitational pull
  64.     if obj == hole or obj.Parent:IsA("Player") then -- Remove obj.Parent:IsA("Player") if you like
  65.         return
  66.     end
  67.  
  68.     -- Exclude anchored objects to maximize performance
  69.     if obj.Anchored then
  70.         return
  71.     end
  72.  
  73.     ApplyGravity(obj)
  74. end
  75.  
  76. game:GetService("RunService").Heartbeat:Connect(function()
  77.     for _, object in pairs(game.Workspace:GetDescendants()) do
  78.         CheckAndApplyGravity(object)
  79.     end
  80. end)
  81.  
  82. -- DAMAGE/KILLER (Kills players when they touch it) --
  83.  
  84. function onTouch(part)
  85.     local humanoid = part.Parent:FindFirstChild("Humanoid")
  86.     if humanoid then
  87.         humanoid.Health = 0
  88.     end
  89. end
  90.  
  91. if killPlayers then
  92.     hole.Touched:Connect(onTouch)
  93. end
  94.  
  95. -- DEMATERIALIZER (Deletes ANY object that touches it) --
  96.  
  97. function onTouched(part)
  98.  
  99.     if part.Anchored then -- Prevent anchored objects from being absorbed
  100.         return
  101.     end
  102.  
  103.     -- Calculate average mean size of objects
  104.     local function CalculateAverageSize(part)
  105.         local size = part.Size
  106.         local averageSize = (size.X + size.Y + size.Z) / 3
  107.         return averageSize
  108.     end
  109.  
  110.     local objectAverageSize = CalculateAverageSize(part)
  111.     local blackHoleSize = hole.Size.X
  112.  
  113.     -- Calculate the new size increment based on the object's average size
  114.     local sizeIncrement = (objectAverageSize / (blackHoleSize * sizeProportion))
  115.  
  116.     part.BrickColor = partColor
  117.     part.Material = partMaterialTransform
  118.     part.CanCollide = collision
  119.     part.Anchored = fixedPosition
  120.  
  121.     for _, transparency in ipairs(transparencySteps) do
  122.         part.Transparency = transparency
  123.         wait(dematerializeDuration)
  124.     end
  125.  
  126.     part:Destroy() -- Delete part after completing transparencySteps
  127.  
  128.     if growth then
  129.         -- Adjust the black hole's size based on the new size increment
  130.         hole.Size = hole.Size + Vector3.new(sizeIncrement, sizeIncrement, sizeIncrement)
  131.         rangeFactor = rangeFactor + sizeIncrement * rangeProportion
  132.     end
  133. end
  134.  
  135. if absorption then
  136.     local connection = hole.Touched:Connect(onTouched)
  137. end
  138.  
  139. if toggleMicroGravity then
  140.     game.Workspace.Gravity = 0
  141. end
Tags: Prototype
Advertisement
Comments
  • 1m1m0
    280 days
    # Lua 2.01 KB | 0 0
    1. -- [ Blackhole 5.0 Source Code Prototype ] --
    2. -- DEV VERSION - Experimental use only
    3.  
    4. local hole = script.Parent
    5. local gravitationalConstant = 1000
    6. local updateInterval = 0
    7. local damping = 0.7
    8. local rangeFactor = 250
    9. local transparencySteps = {0.25, 0.5, 0.75}
    10. local dematerializeDuration = 0.01
    11. local partColor = BrickColor.new(0)
    12. local partMaterialTransform = Enum.Material.Neon
    13. local collision = true
    14. local fixedPosition = false
    15.  
    16. local lastUpdateTime = 0
    17.  
    18. local function ApplyGravity(object)
    19.  
    20.     local currentTime = tick()
    21.     if currentTime - lastUpdateTime < updateInterval then return end
    22.     lastUpdateTime = currentTime
    23.  
    24.     local direction = hole.Position - object.Position
    25.     local distance = direction.Magnitude
    26.     local distanceSquared = ((distance*6400) / (rangeFactor*65)) ^ 2
    27.  
    28.     local magnitude = gravitationalConstant / distanceSquared
    29.     local force = direction.Unit * magnitude * object:GetMass()
    30.  
    31.     local bodyForce = object:FindFirstChild("BlackHoleBodyForce")
    32.     if not bodyForce then
    33.         bodyForce = Instance.new("BodyForce")
    34.         bodyForce.Name = "BlackHoleBodyForce"
    35.         bodyForce.Force = Vector3.new(0, 0, 0)
    36.         bodyForce.Parent = object
    37.     end
    38.  
    39.     bodyForce.Force = (bodyForce.Force + force) * damping
    40. end
    41.  
    42. local function CheckAndApplyGravity(obj)
    43.    
    44.     if not obj:IsDescendantOf(game.Workspace) or not obj:IsA("BasePart") then
    45.         return
    46.     end
    47.  
    48.     if obj == hole or obj.Parent:IsA("Player") then
    49.         return
    50.     end
    51.  
    52.     if obj.Anchored then
    53.         return
    54.     end
    55.  
    56.     ApplyGravity(obj)
    57. end
    58.  
    59. game:GetService("RunService").Heartbeat:Connect(function()
    60.     for _, object in pairs(game.Workspace:GetDescendants()) do
    61.         CheckAndApplyGravity(object)
    62.     end
    63. end)
    64.  
    65.  
    66. function onTouched(part)
    67.    
    68.     part.BrickColor = partColor
    69.     part.Material = partMaterialTransform
    70.     part.CanCollide = collision
    71.     part.Anchored = fixedPosition
    72.    
    73.     for _, transparency in ipairs(transparencySteps) do
    74.         part.Transparency = transparency
    75.         wait(dematerializeDuration)
    76.     end
    77.  
    78.     part:Destroy()
    79. end
    80.  
    81. --[
    82. local connection = hole.Touched:Connect(onTouched)
    83. --]]
    • 1m1m0
      231 days
      # Lua 5.21 KB | 0 0
      1. -- [ Blackhole 5.1 Source Code Prototype ] --
      2. -- Integrated smoother gravitational forces for stable simulations.
      3. -- For archived versions, visit my pastebin: https://pastebin.com/u/1m1m0
      4.  
      5. game.Workspace.Gravity = 0 -- This script works best in zero gravity environments! (Optional)
      6. local hole = script.Parent
      7. local gravitationalConstant = 1000 -- Adjust this value to control the strength of the attraction [1000 is default for a black hole]
      8. local updateInterval = 0 -- Time in seconds between updates while computing (Higher = +Accuracy -Performance, Lower = -Accuracy +Performance)
      9. local damping = 0.7 -- Adjust this value to control the rate of force application [1 is no damping, 0.7 is a suggested starting point]
      10. local rangeFactor = 500 -- Maximum range for objects to be effected [500 studs is default]
      11. local transparencySteps = {0.25, 0.5, 0.75} -- Transparency changes. (Appearing to fade out of reality)
      12. local dematerializeDuration = 0.01 -- How long (seconds) the fading will last (In seconds) on each transparency increment
      13. local sizeProportion = 50 -- Smaller = faster growth for each absorption
      14. local rangeProportion = 125 -- Bigger = faster range growth
      15. local partColor = BrickColor.new(0) -- Color it changes into before getting deleted. (White is default)
      16. local partMaterialTransform = Enum.Material.Neon -- Material it changes into before getting deleted. (Neon is default)
      17. local absorption = true -- Absorb objects that touch the blackhole
      18. local growth = true -- Allow the blackhole to grow by absorption
      19. local killPlayers = true -- Kill players that touch the blackhole
      20. local collision = false -- Make objects pass through eachother while being absorbed
      21. local fixedPosition = false -- Anchor objects while being absorbed (Better FPS)
      22.  
      23. -- gravitational constants of half or a third of 1000 is perfect for gentle simulations.
      24.  
      25. -- GRAVITATIONAL FORCES --
      26.  
      27. local lastUpdateTime = 0
      28.  
      29. local function ApplyGravity(object)
      30.  
      31.     -- Delay to pause calculations for better FPS
      32.     local currentTime = tick()
      33.     if currentTime - lastUpdateTime < updateInterval then return end
      34.     lastUpdateTime = currentTime
      35.  
      36.     -- Main bulk of gravitational forces
      37.     local direction = hole.Position - object.Position
      38.     local distance = direction.Magnitude
      39.     -- ---Dont touch, this formula has been tweaked for exact range of effectiveness!--- --
      40.     local distanceSquared = (distance/((rangeFactor/100) + ((rangeFactor/100)*(1/64)))) ^ 2
      41.     -- --------------------------------------------------------------------------------- --
      42.     local magnitude = gravitationalConstant / distanceSquared
      43.     local force = direction.Unit * magnitude * object:GetMass()
      44.  
      45.     local bodyForce = object:FindFirstChild("BlackHoleBodyForce")
      46.     if not bodyForce then
      47.         bodyForce = Instance.new("BodyForce")
      48.         bodyForce.Name = "BlackHoleBodyForce"
      49.         bodyForce.Force = Vector3.new(0, 0, 0)
      50.         bodyForce.Parent = object
      51.     end
      52.  
      53.     -- Apply damping to the force to prevent instability
      54.     bodyForce.Force = (bodyForce.Force + force) * damping
      55. end
      56.  
      57. -- MAIN GRAVITATIONAL FORCE COMPUTER (Applies gravity to anything) --
      58.  
      59. local function CheckAndApplyGravity(obj)
      60.     -- Check if the object is a descendant of a BasePart (including all physical objects)
      61.     if not obj:IsDescendantOf(game.Workspace) or not obj:IsA("BasePart") then
      62.         return
      63.     end
      64.  
      65.     -- Exclude the black hole itself and players from gravitational pull
      66.     if obj == hole or obj.Parent:IsA("Player") then -- Remove obj.Parent:IsA("Player") if you like
      67.         return
      68.     end
      69.  
      70.     -- Exclude anchored objects to maximize performance
      71.     if obj.Anchored then
      72.         return
      73.     end
      74.  
      75.     ApplyGravity(obj)
      76. end
      77.  
      78. game:GetService("RunService").Heartbeat:Connect(function()
      79.     for _, object in pairs(game.Workspace:GetDescendants()) do
      80.         CheckAndApplyGravity(object)
      81.     end
      82. end)
      83.  
      84. -- DAMAGE/KILLER (Kills players when they touch it) --
      85.  
      86. function onTouch(part)
      87.     local humanoid = part.Parent:FindFirstChild("Humanoid")
      88.     if humanoid then
      89.         humanoid.Health = 0
      90.     end
      91. end
      92.  
      93. if killPlayers then
      94.     hole.Touched:Connect(onTouch)
      95. end
      96.  
      97. -- DEMATERIALIZER (Deletes ANY object that touches it) --
      98.  
      99. function onTouched(part)
      100.  
      101.     if part.Anchored then -- Prevent anchored objects from being absorbed
      102.         return
      103.     end
      104.  
      105.     -- Calculate average mean size of objects
      106.     local function CalculateAverageSize(part)
      107.         local size = part.Size
      108.         local averageSize = (size.X + size.Y + size.Z) / 3
      109.         return averageSize
      110.     end
      111.  
      112.     local objectAverageSize = CalculateAverageSize(part)
      113.     local blackHoleSize = hole.Size.X
      114.  
      115.     -- Calculate the new size increment based on the object's average size
      116.     local sizeIncrement = (objectAverageSize / (blackHoleSize * sizeProportion))
      117.  
      118.     part.BrickColor = partColor
      119.     part.Material = partMaterialTransform
      120.     part.CanCollide = collision
      121.     part.Anchored = fixedPosition
      122.  
      123.     for _, transparency in ipairs(transparencySteps) do
      124.         part.Transparency = transparency
      125.         wait(dematerializeDuration)
      126.     end
      127.  
      128.     part:Destroy() -- Delete part after completing transparencySteps
      129.  
      130.     if growth then
      131.         -- Adjust the black hole's size based on the new size increment
      132.         hole.Size = hole.Size + Vector3.new(sizeIncrement, sizeIncrement, sizeIncrement)
      133.         rangeFactor = rangeFactor + sizeIncrement * rangeProportion
      134.     end
      135. end
      136.  
      137. if absorption then
      138.     local connection = hole.Touched:Connect(onTouched)
      139. end
      • 1m1m0
        229 days
        # Lua 5.33 KB | 0 0
        1. -- [ Blackhole 5.0 Source Code Prototype ] --
        2. -- Integrated smoother gravitational forces for stable simulations.
        3. -- For archived versions, visit my pastebin: https://pastebin.com/u/1m1m0
        4.  
        5. -- No, i did not get a bachelor of physics just for this
        6.  
        7. game.Workspace.Gravity = 0 -- This script works best in zero gravity environments! (Optional)
        8. local hole = script.Parent
        9. local gravitationalConstant = 1000 -- Adjust this value to control the strength of the attraction [1000 is default for a black hole]
        10. local updateInterval = 0 -- Time in seconds between updates while computing (Higher = +Accuracy -Performance, Lower = -Accuracy +Performance)
        11. local damping = 0.7 -- Adjust this value to control the rate of force application [1 is no damping, 0.7 is a suggested starting point]
        12. local rangeFactor = 500 -- Maximum range for objects to be effected [500 studs is default]
        13. local transparencySteps = {0.25, 0.5, 0.75} -- Transparency changes. (Appearing to fade out of reality)
        14. local dematerializeDuration = 0.01 -- How long (seconds) the fading will last (In seconds) on each transparency increment
        15. local sizeProportion = 35 -- Smaller = faster growth for each absorption
        16. local rangeProportion = 125 -- Bigger = faster range growth
        17. local partColor = BrickColor.new(0) -- Color it changes into before getting deleted. (White is default)
        18. local partMaterialTransform = Enum.Material.Neon -- Material it changes into before getting deleted. (Neon is default)
        19. local absorption = false -- Absorb objects that touch the blackhole
        20. local growth = true -- Allow the blackhole to grow by absorption
        21. local killPlayers = true -- Kill players that touch the blackhole
        22. local collision = false -- Make objects pass through eachother while being absorbed
        23. local fixedPosition = false -- Anchor objects while being absorbed (Better FPS)
        24. local forceStabilizer = false -- Toggle to decelerate objects when entering event horizon from infinity
        25.  
        26. -- GRAVITATIONAL FORCES --
        27.  
        28. local lastUpdateTime = 0
        29.  
        30. --[
        31. local function ApplyGravity(object)
        32.  
        33.     local direction = hole.Position - object.Position
        34.     local distance = direction.Magnitude
        35.     local blackHoleRadius = hole.Size.X / 2
        36.  
        37.     -- Prevents objects from accelerating too fast
        38.     if distance < blackHoleRadius and forceStabilizer then
        39.         direction = -direction
        40.     elseif distance < blackHoleRadius then
        41.         return
        42.     end
        43.  
        44.     -- Set up main physics calculations
        45.     local distanceSquared = (distance/((rangeFactor/100) + ((rangeFactor/100)*(1/64)))) ^ 2 -- Dont touch lol
        46.     local magnitude = gravitationalConstant / distanceSquared
        47.     local force = direction.Unit * magnitude * object:GetMass()
        48.  
        49.     local bodyForce = object:FindFirstChild("BlackHoleBodyForce")
        50.     if not bodyForce then
        51.         bodyForce = Instance.new("BodyForce")
        52.         bodyForce.Name = "BlackHoleBodyForce"
        53.         bodyForce.Force = Vector3.new(0, 0, 0)
        54.         bodyForce.Parent = object
        55.     end
        56.  
        57.     -- Apply the force, reversed if within the black hole's volume
        58.     bodyForce.Force = (bodyForce.Force + force) * damping
        59. end
        60.  
        61. -- MAIN GRAVITATIONAL FORCE COMPUTER (Applies gravity to anything) --
        62.  
        63. local function CheckAndApplyGravity(obj)
        64.     -- Check if the object is a descendant of a BasePart (including all physical objects)
        65.     if not obj:IsDescendantOf(game.Workspace) or not obj:IsA("BasePart") then
        66.         return
        67.     end
        68.  
        69.     -- Exclude the black hole itself and players from gravitational pull
        70.     if obj == hole or obj.Parent:IsA("Player") then -- Remove obj.Parent:IsA("Player") if you like
        71.         return
        72.     end
        73.  
        74.     -- Exclude anchored objects to maximize performance
        75.     if obj.Anchored then
        76.         return
        77.     end
        78.  
        79.     ApplyGravity(obj)
        80. end
        81.  
        82. game:GetService("RunService").Heartbeat:Connect(function()
        83.     for _, object in pairs(game.Workspace:GetDescendants()) do
        84.         CheckAndApplyGravity(object)
        85.     end
        86. end)
        87.  
        88. -- DAMAGE/KILLER (Kills players when they touch it) --
        89.  
        90. function onTouch(part)
        91.     local humanoid = part.Parent:FindFirstChild("Humanoid")
        92.     if humanoid then
        93.         humanoid.Health = 0
        94.     end
        95. end
        96.  
        97. if killPlayers then
        98.     hole.Touched:Connect(onTouch)
        99. end
        100.  
        101. -- DEMATERIALIZER (Deletes ANY object that touches it) --
        102.  
        103. function onTouched(part)
        104.  
        105.     if part.Anchored then -- Prevent anchored objects from being absorbed
        106.         return
        107.     end
        108.    
        109.     local initialBlackHoleSize = hole.Size.X
        110.     local initialRangeFactor = rangeFactor
        111.  
        112.     -- Calculate average mean size of objects
        113.     local function CalculateAverageSize(part)
        114.         local size = part.Size
        115.         local averageSize = (size.X + size.Y + size.Z) / 3
        116.         return averageSize
        117.     end
        118.  
        119.     local objectAverageSize = CalculateAverageSize(part)
        120.     local blackHoleSize = hole.Size.X
        121.  
        122.     -- Calculate the new size increment based on the object's average size
        123.     local sizeIncrement = (objectAverageSize / (blackHoleSize * sizeProportion))
        124.  
        125.     part.BrickColor = partColor
        126.     part.Material = partMaterialTransform
        127.     part.CanCollide = collision
        128.     part.Anchored = fixedPosition
        129.  
        130.     for _, transparency in ipairs(transparencySteps) do
        131.         part.Transparency = transparency
        132.         wait(dematerializeDuration)
        133.     end
        134.  
        135.     part:Destroy() -- Delete part after completing transparencySteps
        136.  
        137.     if growth then
        138.         -- Adjust blackhole size
        139.         hole.Size = hole.Size + Vector3.new(sizeIncrement, sizeIncrement, sizeIncrement)
        140.  
        141.         -- Growth ratio
        142.         local growthRatio = hole.Size.X / initialBlackHoleSize
        143.  
        144.         -- Apply growth ratio
        145.         rangeFactor = initialRangeFactor * growthRatio
        146.     end
        147. end
        148.  
        149. if absorption then
        150.     local connection = hole.Touched:Connect(onTouched)
        151. end
  • 1m1m0
    64 days
    # text 2.77 KB | 0 0
    1. --[[
    2.  
    3. -- [Blackhole v5 Prototype Documentation] Nov. 30, 2024 --
    4.  
    5. --------
    6. PHYSICAL
    7.  
    8. IMPORTANT: Note that the blackhole is a MeshPart, resize the blackhole by holding 「alt」 to preserve proportions!
    9.  
    10. 「toggleMicroGravity」 (quickly disable gravity) can be turned off or on if you dont want to go into the game settings manually.
    11.  
    12. Change blackhole properties like 「EventHorizon」 (pitch black effect), color, transparency, mass, custom physical properties and more to your liking.
    13. --------
    14.  
    15. -------
    16. GRAVITY
    17.  
    18. Blackhole v5 Prototype runs on BodyForce-based gravity. Blackhole v4.0+ runs on Velocity-based gravity, v4 Betas are hybrid-based (force or velocity).
    19.  
    20. 「gravitationalConstant」 is the base strength of the blackhole's overall gravity, which are manipulated by 「damping」 (suppresses violent simulation between 0 & 1),
    21. and 「rangeFactor」 (area in studs where objects are pulled in, anything outside that is not affected. gravity is amplified for bigger values).
    22. -------
    23.  
    24. ------------------------
    25. ABSORPTION & PERFORMANCE
    26.  
    27. Objects are absorbed if 「absorption」 is enabled, which will follow 「transparencySteps」 (fading effect between 1 & 0 invisibilities)
    28. in a span of 「dematerializeDuration」 (time to progress each transparency step) while 「partMaterialTransform」 (material absorbed objects turn into) and
    29. 「partColor」 (color absorbed objects turn into) lead the object into deletion, causing 「growth」 to make the blackhole bigger and stronger with
    30. 「sizeProportion」 (how fast the blackhole grows, bigger means slower growth) and 「rangeProportion」 (how fast rangeFactor grows, bigger means faster growth).
    31.  
    32. 「killPlayers」 (kills absorbed players) can be turned on or off when simulating with a player.
    33.  
    34. 「fixedPosition」 (anchor absorbed objects) can help with performance, along with 「collision」 (make objects pass through eachother while being absorbed), and
    35. 「updateInterval」 (value in seconds to update gravitational forces. lower values are accurate but slower, higher values are inaccurate but faster).
    36.  
    37. If 「absorption」 is disabled, everything above within ABSORPTION is excluded EXCEPT 「killPlayers」.
    38. ------------------------
    39.  
    40. --------
    41. ADVANCED
    42.  
    43. If you know how to code, you can edit the script to your liking.
    44.  
    45. Tips:
    46. In 「CheckAndApplyGravity(obj)」, you can change 「if not obj:IsDescendantOf(game.Workspace) or not obj:IsA("BasePart") then return end」 to exclude specific objects.
    47.  
    48. Changing 「if obj == hole or obj.Parent:IsA("Player") then return end」 will cause glitches. however, you may change 「obj.Parent:IsA("Player")」 without issues.
    49.  
    50. Tinkering with 「ApplyGravity(object)」 and 「onTouched(part)」 can throw simulation accuracy off, modify cautiously.
    51. --------
    52.  
    53. ]]
Add Comment
Please, Sign In to add comment
Advertisement