Rock Module based on Battlegrounds game

Ive made a Simple Rock module, which looks very simular to a popular game called The Strongest Battlegrounds"

I saw many battlegrounds games struggle, so i decided to make it free to use!
This video showcases some of the module work

Module link: Link

Functions:

  • RockModule:OnGround( CFrame position , Int value size, boolvalue raw)
  • RockModule:TableFlip( Instance Part)
  • RockModule:Trail( Instance, for example humanoidrootpart Part seconds,Time)

Its my first time posting in Resources, so if you have any idea how can i improve or did something wrong, message down below!

22 Likes

So when i was using it i notice that you use " : " instead of " . " which makes it show that it needs self


As you can see in the image it says some error type and if i change it to this
image

To this
image

Notice the symbol now the error type will gone if i added some typechecking the error type will be gone.

Script -
image

Module Script -
image

Its more readable and i also fixed the raycast filter type to blacklist to exclude which is renamed if u didn’t know why it shows a orange outline.

Here’s the fixed version
Rock Module [Fixed]

6 Likes

@22freshfrenchfries do you approve of this?

you’re wild for that lmao

lets hope he approves

approve what?

don’t mind this, this just to allow me to chat :slight_smile:

so im not that good with module scripts but i have a problem where my rock.Trail function the parts are invisible heres code

For some reason you are using Baseplate for trail (line 14), you should put here HumanoidRootPart

i also have my own rock module, and when you create flinging parts, like the rocks and pebbles, dont use body velocity, it causes it to look bad when it gets spawned, instead do something like this to make them fling in a random direction (and spin slightly to look cool, you can remove it)

rock.AssemblyLinearVelocity = Vector3.new(0, math.random(50, 80), 0) + rock.CFrame.RightVector * math.random(-30, 30) + rock.CFrame.LookVector * math.random(-30, 30) + rock.CFrame.ZVector * math.random(-30, 30)
rock.AssemblyAngularVelocity = Vector3.new(math.random(-8, 8), math.random(-8, 8), math.random(-8, 8))

for me it works, play around with the numbers to get a better result for yourself. this will make your module look a lot better

forgot to mention, when creating the plates, i personally wouldnt use angular velocity, i think it would look better without, but i cant test rn

5 Likes

Hi, the module starts with local Debris = workspace:WaitForChild(“Debris”)

Is the “Debris” variable referring to the Debris service, or a part in the workspace, or smth else? It makes my code infinitely wait for “Debris” in workspace.

I’m pretty sure that it’s referring to a folder named “Debris” in the workspace, which is where, well, the debris gets parented to.

On another note, this module seems cool! might use it for a project I’m working on.

Most likely should be a folder in workspace named “Debris”

I’m having an issue where the trail only follows the player’s HumanoidRootPart when the player is moving across the Z axis. I assume this is because the rocks’ positions are set by changing the X value of the rocks instead of it being relative to the HumanoidRootPart’s LookVector. Here is a screenshot of the lines of code that cause this.

Could someone aid me in making it so that the rocks are accurately placed next to the player when the Trail function is called? Thank you in advance!

Sorry if this problem seems trivial, Luau is a language I am relatively unfamiliar with.

(P.S, how would you put a code block into your posts? What I mean is instead of sending screenshots, people have blocks of code formatted like in Studio.)