GetTouchingParts() returns a table of all the parts touching the objects, meaning you can cycle through all said parts to see if you can find the mop.
Example of implementing this into your code:
local spill = script.Parent
local TweenService = game:GetService("TweenService")
local RunService = game:GetService('RunService')
local partChanges = {
Size = Vector3.new(0.07, 1.15, 1.15),
}
local tweenInfo = TweenInfo.new (
3,
Enum.EasingStyle.Quad,
Enum.EasingDirection.InOut,
0,
false,
0.1
)
local tween = TweenService:Create(spill, tweenInfo, partChanges)
script.Parent.Activated:Connect(onActivation)
local function checkIfTouchingMop()
local touching = spill:GetTouchingParts()
for i = 1,#touching do
local part = touching[i]
if part.Parent.Name == 'Mop' then
return true
end
end
end
spill.Touched:Connect(function()end)
while wait() do
if checkIfTouchingMop() then
if tween.PlaybackState ~= Enum.PlaybackState.Playing then
tween:Play()
end
else
if tween.PlaybackState ~= Enum.PlaybackState.Paused then
tween:Pause()
end
end
end