I need a tool to shoot out an object which will fly towards my mouses' location.
I have this so far, and I'm no good with CFrame -- it's one of my weakness' in Lua.
local Tool = script.Parent
local Shooter = script.Parent.Shooter
local Fireball = game.ServerStorage.fireball
local FireballClone = Fireball:Clone()
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Debounce = false
local CoolDown = 3
Mouse.Button1Down:connect(function(Click)
print("Clicked")
if Debounce == false then
Debounce = true
local F = Fireball:Clone()
local BT = Instance.new("BodyThrust")
BT.Parent = F
BT.Force = Vector3.new(Mouse.Target)
F.Parent = game.Workspace
local SHP = Shooter
F.CFrame = CFrame.new(SHP.Position, SHP.CFrame.lookVector * 100)
F.Anchored = false
F.Velocity = Shooter.CFrame.lookVector * 100
wait(CoolDown)
F:Destroy()
Debounce = false
end
end)
“Insane isn't always black or white. We're all pathological, in our own ways.” |