Made this script so that when a player gets stabbed the part gets stuck inside them, I want it to look like its pierced straight through the middle of the torso, always. But it always spawns somewhere random with random rotation, and if I set rotation of the part a piece of it does not stay put, although it is weld constrained on.
script:
This isnt all of it btw
Tool.EnhancedCone.Touched:Connect(function(Hit)
if attacking then
if Hit.Parent then
if Hit.Parent:FindFirstChild("Humanoid") then
local Humanoid = Hit.Parent:FindFirstChild("Humanoid")
local plr = game:GetService("Players") :GetPlayerFromCharacter(Hit.Parent)
--local vampire = plr:WaitForChild("Classes"):WaitForChild("Vampire") -- RIGHT HERE <---------
if not DB then
DB = true
--if vampire.Value == true then
local ClonedStakeModel = StakeModel:Clone()
ClonedStakeModel.Parent = workspace
ClonedStakeModel.Part.CFrame = Hit.CFrame
local Weld = Instance.new("WeldConstraint")
Weld.Part0 = ClonedStakeModel.Part
Weld.Part1 = Hit
Weld.Parent = ClonedStakeModel
Humanoid.Health -= 100
--else
--Humanoid.Health -= 1
--end
wait(1)
DB = false
end
end
end
end
end)