Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Minecraft like block placement system?

Asked by 4 years ago

I was playing Minecraft and I had an idea of a placement system. But I am stumped.

Problem: When placing blocks and the side of other blocks the go inside each other.

Sample Code:

01local Player = game.Players.LocalPlay
02local mos = Player:GetMouse()
03local part = workspace.Part
04local place = game.replicatedstorage.place
05 
06mos.Move:connect(function()
07    Part.Position = mouse.Hit.p
08end)
09 
10mouse.Clicked:Connect(function() --i know this dosnt work it will just give error. my place got corrupted so i have to remember all code
11    palce:FireServer(mouse.Hit.p)
12end)

The code isnt perfect but i have to type directly into the question box.

If you could help that would be AWSOME

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Idk how to make grid tho... Insert a remote event to replicatedstorage. Then insert a server script in serverscript servicescriptservice. Then type this in the serverscript :

1game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(Player, MousePos)
2local Part = Instance.new("Part",workspace)
3Part.Material = "Grass"
4Part.Position = MousePos
5Part.Anchored = true -- set it to true or false your choice
6Part.Size = Vector3.new(5,5,5)
7end)

then insert a local script to StarterPlayerScripts or StarterGui or StarterPack

then write this in the local script:

1local Mouse = game.Players.LocalPlayer:GetMouse()
2 
3Mouse.Button1Down:Connect(function()
4game.ReplicatedStorage.RemoteEvent:FireServer(Mouse.Hit.Position)
5end)

I havent tested it yet tho Hope it helped :-)

0
This isnt what I mean. I am confused about the placement LOCATION not the script. The blocks when placing it places inside other block and doesn't eject to the side of the block. Here is an example game (Not created by me) https://www.roblox.com/games/4872321990/ deadwalker601 110 — 4y
0
I have building it in a grid done, but when placing on the SIDE of a block, some of it is inside the other. Depending on what side it is +1 or +2 stud to the side deadwalker601 110 — 4y
View all comments (3 more)
0
Heres what i got so far: https://www.roblox.com/games/5652103892/game (Terrible graphics, just a test) deadwalker601 110 — 4y
0
Why does everyone stop helping when problems get hard? deadwalker601 110 — 4y
0
srry for not responding i was busy well u have to make some if statements or idk just search on yt IEntity_303I 80 — 4y
Ad

Answer this question