local TweenService = game:GetService("TweenService")
local player = game.ReplicatedStorage.Events.Tsunami
local part = game.Workspace.Blocker
part.Size = Vector3.new(213.299, 138.575, 4.386)
local goal = {}
goal.Size = Vector3.new(24, 34.458, 4.386)
local tweenInfo = TweenInfo.new(
10,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0)
local tween = TweenService:Create(part, tweenInfo, goal)
local debounce = false
-- Having a debounce so it has a cooldown
part.Touched:Connect(function(hit)
if not debounce then
debounce = true
if hit.Name == "ThePartName" then -- If the touched part's name is the part name we're looking for then we'll play the tween
tween:Play()
end
task.wait(1)
debounce = false
end
end)
tween.Completed:Connect(function()
-- Your code when the tweening is complete.
end)
Explained a few stuff, you can ask more if you don’t understand!
local TweenService = game:GetService("TweenService")
local player = game.ReplicatedStorage.Events.Tsunami
local part = game.Workspace.Blocker
part.Size = Vector3.new(213.299, 138.575, 4.386)
local debounce = false
-- Having a debounce so it has a cooldown
part.Touched:Connect(function(hit)
if not debounce then
debounce = true
if hit.Name == "ThePartName" then -- If the touched part's name is the part name we're looking for then we'll play the tween
local goal = {}
goal.Size = Vector3.new(24, 34.458, 4.386)
local tweenInfo = TweenInfo.new(
10,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0)
local tween = TweenService:Create(part, tweenInfo, goal)
tween:Play()
end
task.wait(1)
debounce = false
end
end)
tween.Completed:Connect(function()
-- Your code when the tweening is complete.
end)
script.Parent.Touched:Connect(function(hit)
if hit then
workspace.Blocker.Size = Vector3.new(213.299, 138.575, 4.386)
TweenService:Create(workspace.Blocker, TweenInfo.New(10), {Size = Vector3.new(24, 34.458, 4.386)}):Play()
end
end)