Okay. For a few days now I have been struggling to make this work, tried multiple forum posts, nothing has worked. I will just show everything I got and hope someone can help.
What it is suppose to do: Place a chair, with the lego pegs on top
What the issue is: The chair goes underground and the pegs go on ground?
https://gyazo.com/e10a25b7a961634b5e73fe281d0ffad0
And it won’t even move, it is suppose to place where I click. After trying it on the side of my baseplate I noticed the pegs switch with other blocks.
Here is what I have:
In ReplicatedStorage:
![]()
In ServerScriptService:
![]()
In StarterPack:

Now my code
Server Script:
local RS = game:GetService('ReplicatedStorage')
local Event = RS:WaitForChild('PlaceBlock')
-- PlaceBlock Event
Event.OnServerEvent:Connect(function(plr,target,pos,Block)
local xBlock = Block:Clone()
--local model = xBlock
local model = game.ReplicatedStorage.ChairTrap
xBlock.Trap.Position = target.Position + pos
xBlock.Parent = game.Workspace
model.PrimaryPart = model.Trap
model:SetPrimaryPartCFrame(xBlock.Trap.CFrame)
print(target)
end)
Client:
-- Variables
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local position = mouse.Hit.p
local UIS = game:GetService('UserInputService')
local RS = game:GetService('ReplicatedStorage')
local tool = script.Parent
local Event = RS:WaitForChild('PlaceBlock')
local pos
local Chair = game.ReplicatedStorage.ChairTrap
local LegoPegs = game.ReplicatedStorage.ChairTrap.Union
local ChairTrap = Chair and LegoPegs
local model = game.ReplicatedStorage.ChairTrap
model.PrimaryPart = model.Trap
-- Surface Detection
local function Surface(surface)
if surface.Name == "Top" then
local position = mouse.Hit.p
print(surface.Name)
print(position)
pos = Vector3.new(position.X,0,position.Z)
elseif surface.Name == "Bottom" then
local position = mouse.Hit.p
pos = Vector3.new(position.X,0,position.Z)
elseif surface.Name == "Front" then
local position = mouse.Hit.p
pos = Vector3.new(position.X,0,position.Z)
elseif surface.Name == "Back" then
local position = mouse.Hit.p
pos = Vector3.new(position.X,0,position.Z)
elseif surface.Name == "Left" then
local position = mouse.Hit.p
pos = Vector3.new(position.X,0,position.Z)
elseif surface.Name == "Right" then
local position = mouse.Hit.p
pos = Vector3.new(position.X,0,position.Z)
end
return pos
end
-- Place Block
script.Parent.Activated:Connect(function()
local target = mouse.Target
if target then
local surface = mouse.TargetSurface
local pos = Surface(surface)
Event:FireServer(target,pos,Chair)
end
end)
