I made a script that teleports a brick to the player's torso, all is well until i go next to another part. When i go next to another part, my brick goes over my head or the part im next to.
replicatedstorage = game:GetService("ReplicatedStorage") tool = script.Parent.Parent.Parent Smite = replicatedstorage:FindFirstChild("RicoClass").Smite baseAtk = 32 debounce = true M = replicatedstorage:FindFirstChild("RicoClass").SmiteModel shockwave = replicatedstorage:FindFirstChild("RicoClass").Shockwave Smite.OnServerEvent:connect(function(player) local root = player.Character:FindFirstChild("HumanoidRootPart") local m = M:clone() local smiteM = m:GetChildren() local shockW = shockwave:clone() local dmg = math.floor(script.Parent:FindFirstChild("Charging").Value / 1.6 + baseAtk + 0.5) print(script.Parent:FindFirstChild("Charging").Value) wait() print("s") -------------------------------------------------------- for i, v in pairs(smiteM) do -----Goes into a Model i made if v.Name == "Inner" then ----After going through the model, it gets looks like the model that is named "inner" v.CFrame = root.CFrame + Vector3.new(0,-5,0) ----My teleporter v.Parent = game.Workspace v.Rotation = Vector3.new(0,0,90) for i = 0,3,0.5 do -----makes sure the brick teleports to my player's torso wait(0.01) v.CFrame = root.CFrame + Vector3.new(0,-5,0) v.Rotation = Vector3.new(0,0,90) v.Size = v.Size + Vector3.new(0,i,i) v.CFrame = root.CFrame + Vector3.new(0,-5,0) v.Rotation = Vector3.new(0,0,90) end wait() for i = v.Transparency,1,0.025 do ---reassures that my part gets teleported and slowly changes brick transparency. wait(0.01) v.CFrame = root.CFrame + Vector3.new(0,-5,0) v.Rotation = Vector3.new(0,0,90) v.Transparency = i v.CFrame = root.CFrame + Vector3.new(0,-5,0) v.Rotation = Vector3.new(0,0,90) 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 -------------------------------------------------------- wait(0.1) script.Parent:FindFirstChild("Charging").Value = 0 end)