PlacementEvent.OnServerEvent:Connect(function(Player,PreviewObject,ObjectCFrame)
local Object = ObjectFolder:FindFirstChild(PreviewObject):Clone()
Object:SetPrimaryPartCFrame(ObjectCFrame)
Object.Parent = game.Workspace
local pu = 3
local db = true
Object.PrimaryPart.Touched:Connect(function(hit)
if db then db = false
print(hit.Name)
task.wait(pu)
db = true
end
end)
end)
While I did some problem-solving and testing, I have solved the problem and I’ll give you the script I did.
In Roblox Studio, I added Part A and B but this is an example.
Part A needs to touch the Part B so I added a script inside ‘Part B’.
If Part B detects a part which named ‘Part A’, this will bring out an output.
This is what I did in the script but this is inside ‘PartB’:
local part = script.Parent
part.Touched:Connect(function(hit)
if hit.Name == "PartA" then
print("TOUCHED")
else
print("NOT TOUCHED")
end
end)