Alright so I'm trying to make a HP Wand, and i'm facing a Setback, RN the Only way to make my wands work is Lookvector
, I don't know How to Make it Face the Way my Mouse is Facing, Everything else Works Fine.
Heres my Code
****Local****
local ReplicatedStorage = game.ReplicatedStorage local event = ReplicatedStorage.AvadaKedavra local player = game.Players.LocalPlayer local mouse = player:GetMouse() local Green = script.Parent.Attachment.Green local Purple = script.Parent.Attachment.Purple local Blue = script.Parent.Attachment.Blue local Orange = script.Parent.Attachment.Orange local Red = script.Parent.Attachment.Red local Pink = script.Parent.Attachment.Pink player.Chatted:Connect(function(msg) local msg = msg:lower() if msg:match("avada kedavra") then local spell = true Green.Enabled = true -- Clicked mouse.Button1Down:Connect(function() if spell then event:FireServer(mouse.Hit.p) Green.Enabled = false spell = false end end) end end)
****Server****
local Spell = game.ServerStorage:WaitForChild("Spell") game.ReplicatedStorage.AvadaKedavra.OnServerEvent:Connect(function(player) local character = player.Character local newSpell = Spell:Clone() newSpell.CFrame = character.HumanoidRootPart.CFrame local bodyVelocity = Instance.new("BodyVelocity") bodyVelocity.MaxForce = Vector3.new(500,500,500) bodyVelocity.Velocity = (character.HumanoidRootPart.CFrame.lookVector*250) bodyVelocity.Parent = newSpell newSpell.Parent = workspace local touchConn touchConn = newSpell.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if hit.Parent.Name ~= player.Name then hit.Parent:BreakJoints() if touchConn ~= nil then touchConn:Disconnect() end local Debris = game.ServerStorage.Debris:Clone() Debris.Parent = newSpell bodyVelocity:Destroy() wait(2) newSpell:Destroy() end end end) wait(30) if touchConn == nil then touchConn:Disconnect() end local Debris = game.ServerStorage.Debris:Clone() Debris.Parent = newSpell bodyVelocity:Destroy() wait(2) newSpell:Destroy() end)
Could anyone Help me Figure this Out?