local fireball = game:GetService("ReplicatedStorage"):FindFirstChild("fireball")
fireball.OnServerEvent:Connect(function(player, mousePos)
local character = player.Character
local fireball = game:GetService("ReplicatedStorage"):FindFirstChild("Fireball"):Clone()
fireball.Parent = game.Workspace
fireball.Size = Vector3.new(2, 2, 2)
fireball.CFrame = character:WaitForChild("HumanoidRootPart").CFrame * CFrame.new(0, 10, 0)
fireball.Massless = true
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(3, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out, 0, false, 0)
local properties = {
Color = Color3.fromRGB(255, 0, 0),
Size = Vector3.new(15, 15, 15),
Anchored = true
}
local Tween = TweenService:Create(fireball, Info, properties)
Tween:Play()
Tween.Completed:Wait()
fireball.Anchored = false
local bv = Instance.new("BodyVelocity", fireball)
bv.Velocity = CFrame.new(fireball.CFrame.Position, mousePos).lookVector * 50
bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
end)
I want to make this into a module that is a tween, so that when I use input began I will tween it and it will get bigger, and when I ended the keypress I will add body velocity on the fireball so it will execute. However, I cant seem to make a module script with tween service and in the UIS.
Thanks for the help in advance!