I’ve been trying to create a mock admin command that pulls people in, which is something i’ve done before, but for some reason, things have gone weirdly this time.
No matter what i try and do, the player is always pulled towards the world origin, instead of the attachment point, which the client and server both agree on the position of (everything is done by serverscript, anyway)
What’s going on here?
“Attachment” is the attachment at the centre of the green-teal sphere.
“CrushPull” is the attachment attached to each joint of the player.
Here’s the relevant section of code. It’s quite a mess because of the amount of testing i’ve been doing to try and solve this.
local Inrange = workspace:GetPartBoundsInRadius(Crush.Position, 10)
local PullHitCharacters = {}
for _, Part in Inrange do
if Part.Parent:FindFirstChildOfClass("Humanoid") then
if (not table.find(PullHitCharacters, Part.Parent)) or Part.Parent:FindFirstAncestorOfClass("Humanoid") then
table.insert(PullHitCharacters, Part.Parent)
--Part.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(1000)
for _,PartInModel in Part.Parent:GetChildren() do
if not PartInModel:IsA("BasePart") then continue end
if PartInModel.Anchored ~= true then pcall(function() Part:SetNetworkOwner(nil) end) end
local AT1= Instance.new("Attachment")
AT1.Parent = Part.Parent.HumanoidRootPart
AT1.Name = "Crushpull"
local Force = script.LineForceBase:Clone()
Force.Name = "CharacterForce"
Force.Attachment1 = AT1
Force.Attachment0 = Crush.Attachment
Force.Parent = Crush
--TweenService:Create(NewForce, CrushTween, {Magnitude = 1000000}):Play()
end
--task.delay(399, function()
--Part.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(1000)
--end)
end
end
end
p.s: removing the line that sets networkownership doesn’t help