-
What do you want to achieve? Keep it simple and clear!
A wave that can destroy objects by chance and make them collapse -
What is the issue? Include screenshots / videos if possible!
I am trying to make it detect objects that are not locked.
script:
if script.Parent.Parent == workspace then local TweenService = game:GetService("TweenService") local ev_tweeninfo = TweenInfo.new( 1, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0 ) function evaporate(part) local b = TweenService:Create(part, ev_tweeninfo, {Transparency = 1}) b.Completed:Connect(function() part:Destroy() end) end local tsunami = script.Parent local hitbox = script.Parent.hitbox hitbox.Touched:Connect(function(hit) print(hit) print("hit something unlocked") if hit.Locked == false then hit.Anchored = false local a = math.random(1,20) if a == 1 then evaporate(hit) end end end) end