Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I use TweenService to resize an enemy NPC's shockwave ability?

Asked by 3 years ago

Alright I know that the title is kind of confusing so I'll explain it here instead.

I'm making an hostile NPC that attacks player, I've already figured out the pathfinding but now I want it so that after a certain amount of time it would release like a shockwave and then damage players that is inside the shockwave ball. I know that I have to use TweenService for this but I'm fairly new to TweenService and after reading the official article and looking up a few tutorials, I am still really confused.

Short version: How do I use TweenService to resize a sphere part?

1 answer

Log in to vote
0
Answered by 3 years ago

If you want to tween an object, you will need : a goal, tweeninfo and an instance

Syntax

local TweenService = game:GetService("TweenService")

--The ball you want to tween
local ball = 

--Tweening

local tweeninfo = TweenInfo.new(length of tween)
local goal = {}
goal.Size = Vector3.new(x,y,z)

local tween = TweenService:Create(ball, tweeninfo, goal)
tween:Play()

Hope it helps!

0
Damn, thank you for the simple explanation and the code. johncrazy1rb 11 — 3y
Ad

Answer this question