I want to achieve that the placement system that places a structure for each click, the issue is that it only places one structure each two clicks meaning:
Click 1: Saves block1
Click 2: Places block1 and saves block2
And this is goes on and on, i do not know how to solve this as i do not know what causes this problem…
Server script:
elseif Action == "Building" then
if workspace:FindFirstChild("Buildings") then
if BuildingsFolder:FindFirstChild(Player.Name) then
local FoundBuild = game.ReplicatedStorage.Builds:FindFirstChild(CurrentInstance)
if FoundBuild then
local NewBlock = FoundBuild:Clone()
NewBlock.PrimaryPart = FoundBuild:FindFirstChild(FoundBuild.Name)
if (Character:FindFirstChild("HumanoidRootPart").Position - CurrentInstancePosition).Magnitude <= 50 then
local PlayersBuilds = BuildingsFolder:FindFirstChild(Player.Name)
NewBlock.PrimaryPart.Position = CurrentInstancePosition
NewBlock.Parent = PlayersBuilds
return true,""
elseif (Character:FindFirstChild("HumanoidRootPart").Position - CurrentInstancePosition).Magnitude > 50 then
return false,""
end
elseif not FoundBuild then
return false,""
end
elseif not BuildingsFolder:FindFirstChild(Player.Name) then
return false,""
end
end
end