Projectile SERVERSCRIPT
game.ReplicatedStorage.Light.OnServerEvent:Connect(function(player, keyheld, debounce, mousepos) print(keyheld) if keyheld == true then local light = game.ReplicatedStorage.LightPart1:Clone() light.Parent = workspace light.CFrame = player.Character.RightFoot.CFrame local weld = Instance.new("Weld") weld.Parent = light weld.Part0 = light weld.C0 = light.CFrame:Inverse() weld.Part1 = player.Character.RightFoot weld.C1 = player.Character.RightFoot.CFrame:Inverse() end if not keyheld then if game.Workspace:FindFirstChild("LightPart1") then game.Workspace.LightPart1:Destroy() local ball = game.ReplicatedStorage.LightBall:Clone() ball.Parent = player.Character ball.CFrame = player.Character.RightFoot.CFrame local bv = Instance.new("BodyVelocity") bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge) bv.Velocity = mousepos.lookVector*90 bv.Parent = ball end end end)
Projectile Hit Detection LOCALSCRIPT
script.Parent.Touched:Connect(function(hit) print("Hit1") local ehum = hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid") local debounce = false if ehum and ehum ~= game.Players.LocalPlayer.Character.Humanoid and debounce == false then game.ReplicatedStorage.Hit:FireServer(ehum) end if not ehum and debounce == false then game.ReplicatedStorage.Hit:FireServer(hit) end end)
The entire thing works fine if I parent the "Ball" projectile to the Character Model, but it doesn't work when its parented anywhere else even though I'd much prefer it to be parented in workspace.