Basically I need a part to be always 300 units away from the player on the +X axis, but when I try that part moves all jittery. Here's the code i'm using:
if script.Parent.Parent == workspace.Gamespace then
local RunService = game:GetService('RunService')
local countDownValue = 100
local function update()
if script.Parent.Player.Value.Humanoid.Health < 1 then
script.Parent:Destroy()
end
if script.Parent.Health.Value > 0 then
local oldCFrame = script.Parent.Player.Value.HumanoidRootPart.CFrame
oldCFrame = oldCFrame + Vector3.new(300,0,0)
script.Parent.CFrame = oldCFrame
script.Parent.Size = Vector3.new(3,3,3)
if script.Parent.Position.Z < 84 then
script.Parent.Transparency = 1
else
script.Parent.Transparency = 0
end
else
countDownValue = countDownValue - 0.5
script.Parent.Size = Vector3.new((countDownValue/100)*3,(countDownValue/100)*3,(countDownValue/100)*3)
script.Parent.Transparency = 1-(countDownValue/100)
if countDownValue < -150 then
script.Parent.Anchored = true
script.Parent.Health.Value = 100
countDownValue = 100
end
end
end
RunService.Stepped:Connect(function(step)
pcall(update)
end)
end
(This script would be inside the part being moved, and script.Parent.Player is an ObjectValue that contains the player character)

2 comments
well i tried that when i ran local oldCFrame = script.Parent.Player.Value.HumanoidRootPart.CFrame oldCFrame = oldCFrame + Vector3.new(300,0,0) script.Parent.CFrame = oldCFrame, but no luck
i just tested it but with the code slightly modfied so i could get get access to to player and part, and it worked..