-
What do you want to achieve? Keep it simple and clear!
I want to make my projectile shoot from the mouse cursor instead of from a part on my humanoid. -
What is the issue? Include screenshots / videos if possible!
script.Parent.Fire.OnServerEvent:Connect(function(plr, mousePos)
local firepart = plr.Character:FindFirstChild(‘SpellFirePoint’)
if firepart ~= nil then
local bv = Instance.new('BodyVelocity')
bv.MaxForce = Vector3.new(30000,30000,30000)
bv.Velocity = firepart.CFrame.lookVector * boogerSpeed
local boogerClone = booger:Clone()
boogerClone.Parent = workspace
boogerClone.CFrame = firepart.CFrame
boogerClone.CFrame = CFrame.new(boogerClone.Position, mousePos)
bv.Parent = boogerClone
game.Debris:AddItem(boogerClone, boogerLifetime)
boogerClone.Touched:Connect(function(hit)
if hit.Parent.Name == plr.Name then return end
if hit.Parent:FindFirstChild('Humanoid') then
hit.Parent.Humanoid.WalkSpeed *= 0.5
hit.Parent.Humanoid.Health -= boogerDamage
boogerClone:Destroy()
wait(1)
hit.Parent.Humanoid.WalkSpeed *= 2
end
end)
end
end)
````
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Yeah, but I couldn’t find any that helped me with my situation. It’s probably an easy fix, but I can’t figure it out.