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

3d building system fails to function as intended, is there a reason why?

Asked by
Joshument 110
5 years ago

Here is my LOCAL script:

01local Players = game:GetService("Players")
02local Camera = workspace.CurrentCamera
03local UIS = game:GetService("UserInputService")
04local rs = game:GetService("RunService").RenderStepped
05local ReplicatedStorage = game:GetService("ReplicatedStorage")
06local Ghost = ReplicatedStorage.ItemIndicator
07local buildmode = true
08local Item = "Plastic Test Brick"
09Ghost.Parent = workspace
10 
11local mousePos
12local mouseTarget
13local gridPos
14local canPlace
15 
View all 67 lines...

Here is my SERVER script, but I don't think the problem is it:

01local rs = game:GetService("ReplicatedStorage")
02local ss = game:GetService("ServerStorage")
03 
04rs.PlacePart.OnServerEvent:Connect(function(player, position, partType)
05    local part = ss:WaitForChild(partType, 5):Clone()
06    if part then
07        part.Position = position
08        part.Parent = workspace
09    else
10        error("Part Failed to Load")
11    end
12end)

P.S. There are no errors in the output.

The problem I have is that when using the grid movement, these three things happen:

  • Parts fail to go to the right area
  • Ghost part fails to turn red when region3 detects a problem
  • Bricks do not get placed

Here's a gif if it makes it easier: https://gyazo.com/cdb07c9616926c4bdd99ce4a5eca1d51

I've tried countless times to make this work, but I can't seem to get it right, thank you if you can solve it!

Answer this question