Trying to make a gaster blast that looks at the mouse, but if the mouse looks up at the sky make it just face the direction excluding the y axis…
if Char:FindFirstChild("Gaster Blaster") and Gaster then
if sf.SetCooldown({plr = player, ability = "Gaster1", check = true}) then return end
sf.SetCooldown({plr = player, ability = "Gaster1", dura = 2})
local gasterCopy = repStorage.Rigs["Gaster Blaster"]:Clone()
gasterCopy.PrimaryPart.Position = (Root.CFrame * CFrame.new(Random.new():NextNumber(-20, 20), 2,0)).Position
gasterCopy.PrimaryPart.CFrame = CFrame.lookAt(gasterCopy.PrimaryPart.Position, Vector3.new(mouseHit.Position.X, 0, mouseHit.Position.Z))
gasterCopy.Parent = workspace.Effects
for Index, BodyParts in ipairs(gasterCopy:GetChildren()) do
if BodyParts:IsA("BasePart") and BodyParts.Name ~= "HumanoidRootPart" then
TweenModule.obj(BodyParts, "Quad", "InOut", .4, {Transparency = 0})
end
end