Having a bit of a issue.
Model is not being cloned, and instead using the real one.
Local script:
local mouse = game.Players.LocalPlayer:GetMouse()
local connection = mouse.Move:connect(function()
if mouse.Target == nil then
-- nothing
else
if workspace.Pipes:FindFirstChild(mouse.Target.Parent.Name) then
local ty
if mouse.Target.Name == 'LeftOpening' or mouse.Target.Name == 'RightOpening' or mouse.Target.Name == 'FrontOpening' or mouse.Target.Name == 'BackOpening' then
local dist = mouse.Hit.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position
game.ReplicatedStorage.Place:FireServer(mouse.Target.Parent,mouse.Target.Parent[mouse.Target.Name].Name,'Pipe',mouse.Target.CFrame)
end
end
end
end)
Server Script:
game.ReplicatedStorage.Place.OnServerEvent:Connect(function(p,object,whichopening,whatplacement,cf)
if workspace.Pipes:FindFirstChild(whatplacement) then
local tree = {
["Pipe"] = workspace.Pipes.Pipe:Clone(),
["Corner"] = workspace.Pipes.Corner:Clone(),
["FourWay"] = workspace.Pipes.FourWay:Clone()
}
-- alright
if tree[whatplacement] then
if object:FindFirstChild('LeftTaken') then
if object['LeftTaken'].Value == true and whichopening == object['LeftOpening'].Name then
-- we can't place it.
else
local spare = workspace.Pipes[whatplacement]:Clone()
spare.PrimaryPart.CFrame = cf
object['LeftTaken'].Value = true
local wel = Instance.new('WeldConstraint',object[whichopening])
wel.Part0 = object[whichopening]
wel.Part1 = spare['LeftOpening']
spare['LeftTaken'].Value = true
end
end
if object:FindFirstChild('RightTaken') and whichopening == object['RightOpening'].Name then
if object['RightTaken'].Value == true and whichopening == object['RightOpening'].Name then
-- we can't place it.
else
local spare = workspace.Pipes[whatplacement]:Clone()
spare.PrimaryPart.CFrame = cf
object['RightTaken'].Value = true
local wel = Instance.new('WeldConstraint',object[whichopening])
wel.Part0 = object[whichopening]
wel.Part1 = spare['RightOpening']
spare['RightTaken'].Value = true
end
end
if object:FindFirstChild('FrontTaken') and whichopening == object['FrontOpening'].Name then
if object['FrontTaken'].Value == true and whichopening == object['FrontOpening'].Name then
-- we can't place it.
else
local spare = workspace.Pipes[whatplacement]:Clone()
spare.PrimaryPart.CFrame = cf
object['FrontTaken'].Value = true
local wel = Instance.new('WeldConstraint',object[whichopening])
wel.Part0 = object[whichopening]
wel.Part1 = spare['LeftOpening']
spare['FrontTaken'].Value = true
end
end
if object:FindFirstChild('BackTaken') and whichopening == object['BackOpening'].Name then
if object['BackTaken'].Value == true and whichopening == object['BackOpening'].Name then
-- we can't place it.
else
local spare = workspace.Pipes[whatplacement]:Clone()
spare.PrimaryPart.CFrame = cf
object['BackTaken'].Value = true
local wel = Instance.new('WeldConstraint',object[whichopening])
wel.Part0 = object[whichopening]
wel.Part1 = spare['RightOpening']
spare['BackTaken'].Value = true
end
end
end
end
end)
--[[
local wel = Instance.new('Weld',object[whichopening])
wel.Part0 = object[whichopening]
wel.Part1 =
workspace.Pipes.Pipe.PrimaryPart.CFrame = cf]]
Here’s examples.
Here’s when I remove :Clone()
and use the real model.
https://gyazo.com/ff0874a914422cabf15286560352932e
Here’s when I put back :Clone()
.
https://gyazo.com/1330577a912b5f51213ce3dfb35091ca
Anyone have a fix for this?
Also, this post is related to Pipe System - Build System
I am currently only looking for a solution.
Thanks!
I am extremely puzzled by this.