I made a script that makes a brick get CFramed to the HumanoidRootPart of a character. All is well until i try to go near another player, the CFramed brick gets spawned over my head. How do i fix this.
tool = script.Parent.Parent.Parent
Smite = replicatedstorage:FindFirstChild("RicoClass").Smite
baseAtk = 32
M = replicatedstorage:FindFirstChild("RicoClass").SmiteModel
local m = M:clone()
local smiteM = m:GetChildren()
for i, v in pairs(smiteM) do
if v.ClassName == "Part" then
v.CFrame = root.CFrame + Vector3.new(0,-5,0)
v.Parent = game.Workspace
v.Rotation = Vector3.new(0,0,90)
for i = 0,3,0.5 do
wait(0.01)
v.Size = v.Size + Vector3.new(0,i,i)
end
wait()
for i = v.Transparency,1,0.025 do
wait(0.01)
v.Transparency = i
end
v.Touched:connect(function(hit)
local opponent = hit.Parent:findFirstChild("Humanoid") or hit.Parent.Parent:findFirstChild("Humanoid")
if opponent and opponent ~= player.Character.Humanoid then
opponent:TakeDamage(dmg)
end
end)
wait()
v:remove()
end
end

1 comment
Weld it?