If you look at the video, you move the parts in front of another booth and they don’t return to their original position.
Originally, they have to return to their previous position when the parts are out of work, as shown in the later part of the video.
local toolEvent = ReplicatedStorage:WaitForChild("ToolEvent")
toolEvent.OnServerEvent:Connect(function(player, target, newCFrame)
local originPosition = target.Position
local whitePart = TierModel.WhiteListPart
if target and newCFrame then
local partName = target.Name
local playerValue = player:FindFirstChild(partName)
if playerValue == nil then
return false
end
if target.Name ~= playerValue.Name then
return false
end
local originalCFrame = target.Position
if target.Locked then
return false
end
target.Position = newCFrame
local partsInTestPart = workspace:GetPartsInPart(whitePart)
local targetIncluded = false
for _, part in ipairs(partsInTestPart) do
if part == target then
targetIncluded = true
break
end
end
if not targetIncluded then
target.Position = originalCFrame
end
end
end)
There is a WhiteListPart within the workspace, and if the part leaves the area, it is supposed to return to its previous location.
This is the same for other booths. In other words, the same WhiteListPart exists in front of that booth.
What’s the problem? The WhiteListPart in the other booth was not declared in that code at all.
Just in case, I tried changing the name to something else, but I encountered the same result. I have no idea what the problem is.