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

how to aim this attack at mouse?

Asked by 4 years ago

i wana make this aim at the mouse, but I dunno how, it may be obvious whats wrong and I'm just stupid, as you'll see in the code I was trying to make it happen. any help would be appreciated

local chr = player.Character
    local rarm = chr["Right Arm"]
    local hed = chr["Head"]
    local hrp = chr["HumanoidRootPart"]
    local blast = game.ServerStorage.HolyBlast

    local thrown = false

    wait(0.5)
    thrown = true
    local projectileblast = blast:Clone()
        projectileblast.Parent = game.Workspace.Effects
        local Mouse = player:GetMouse()
    projectileblast.CFrame = CFrame.new(Mouse.Hit.p) * cf(1, 0, -3) * ang(rd(0), rd(0), rd(0))
            projectileblast:SetNetworkOwner(nil)

    local boopyve = Instance.new("BodyVelocity")
    boopyve.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
    boopyve.P = math.huge
    boopyve.Velocity = hrp.CFrame.LookVector * 1000
    boopyve.Parent = projectileblast

    local traveldistance = 0

Answer this question