local remote = game.ReplicatedStorage.Remotes.PlaceItem
remote.OnServerEvent:Connect(function(plr,itemname,cframe,itemtype,move,item)
local item2
if itemtype == "Structures" then
item2 = game.ReplicatedStorage.Structures:FindFirstChild(itemname):Clone()
elseif itemtype == "Blueprints" then
item2 = game.ReplicatedStorage.Blueprints:FindFirstChild(itemname):Clone()
end
plr.PlaceCooldown.Value = true
if move == false then
for i,v in pairs(workspace.Plots:GetChildren()) do
if v.Owner.Value == plr.Name then
if itemtype == "Structures" then
local itemremoved = false
for i,b in pairs(plr.Inventory.Structures:GetChildren()) do
if b.Name == item2.Name then
if itemremoved == false then
b.ToSave.Amount.Value -= 1
if b.ToSave.Amount.Value <= 0 then
b:Destroy()
end
itemremoved = true
end
item2.Parent = v.Structures
item2.Parts:SetPrimaryPartCFrame(cframe)
end
end
elseif itemtype == "Blueprints" then
item2.Parent = v.Structures
item2.Parts:SetPrimaryPartCFrame(cframe)
end
end
end
else
for i,v in pairs(workspace.Plots:GetChildren()) do
if v.Owner.Value == plr.Name then
item.Parts:SetPrimaryPartCFrame(cframe)
end
end
end
plr.PlaceCooldown.Value = false
end)
i found the issue. it was my fault, in the second line i do workspace.Placing:ClearAllChildren() and then when i fire the remote, i was trying to get itemTransparent.Parts.PrimaryPart.CFrame, but itemTransparent was a child of workspace.Placing, so it didnt exist