I need help making a block placement system like Roblox BedWars. I have come across a few posts on this already, but I can’t quite seem to grasp the solution. I have intermediate scripting knowledge. Any help is a appreciated
First, let’s divide it into some simple steps.
- Detect that player wants to place a block (in
LocalScript
usingUserInputService
, we will fire aRemoteEvent
to the server) - Detect where player wants to place block (via
RemoteFunction
) - Some anti-cheat checks (y̶̡̰̏o̸̲͖̓u̵̻̻͊͘ ̸̧̇ͅȁ̸͇ȑ̶̘ề̵̡͈ ̸̢̦́̃n̸͔̎e̷̮͋̒v̷͙̠̉͝e̶͔̒r̶̗͒͜ ̶̘͉͊͠s̸̮͠a̷̰̖͐̀f̶̛̣̗͝e̷̙̒͘͜ ̴͈̟́̚f̸̯͑ř̴̭̙o̷̤̾͋m̸̖̩̆ ̴̧͌̂t̴̠̓h̶͔̅̿ĕ̶͙̻ḿ̴̛̥̖) (on server script!)
- Create a new part and place it right where the mouse hit position was.
- The part will be inside other parts - we will have to adjust its position (we will offset it by half its size, depending on where it collides)
You are done.
I am not currently in studio, can’t show you any examples unfortunately.
edit: forgot to add we will also have to check if part fits
I should have mentioned, the main thing I want to achieve is the bridging aspect of BedWars. How would I do that?
I also found this post, where someone said: “Create an invisible plane 1 block below the player with math. If the player’s ray goes past it, find the point at which the ray was intersected and place a block there.”
I’m not quite sure how I would do that, maybe you tell me?
Yeah I know how to make a simple placement system, but I want a bit more than that. Here’s a little video bridging: https://www.youtube.com/watch?v=7m6nwbemyiY