How Would I Fix These Two Issues?

Hello There! I Am Currently Dealing With A Problem Where I Am Unable To Figure Out How I Would Check If Multiple Players Are Moving, And How To Move Them Exactly Relative To Their Velocity. For Example, If The Player Is Running, The Player Would Need To Move Accordingly To Their LookVector Toward A Position They’d Reach Within 1/4 Of A Second Based On Their WalkSpeed. And Or If The Player Has Jumped, They’d Need To Move Accordingly Toward Their UpVector Based On Their JumpPower. Or, If The Player Is Falling, They Would Move Depending On How Gravity Is Affecting Them And How Far They’d Fall Within 1/4 Of A Second. I’ve Tried A Few Ways To Achieve This But I Couldn’t Figure Out How To Do It. The Reason Why I Wanted To Make This Script Is Because I Wanted To See If I Could Create A Realistic Time Skip Teleport. (Similar To King Crimson’s Ability From Jojo’s Bizzare Adventure) And What It Would Look Like. Just Something For Fun That I Would Enjoy Experimenting With.

Here Is The Script (It Is A Server Script Located In ServerScriptService)

--Remote Function Variables--
local RS = game.ReplicatedStorage
local TETeleport = RS.TETeleport
--Sub Functions--
function SkipSound()
	for I,V in pairs(game:GetDescendants()) do
		if V ~= nil and V:IsA("Sound") and V.IsPlaying and V.Name ~= "TimeSkip" then
			local NewPosition = V.TimePosition + .5
			if NewPosition >= V.TimeLength then
				V.TimePosition = 0
			else
				V.TimePosition = NewPosition
			end
		end
	end
end
---------------------------------
function SkipTextureOffset()
	for I,V in pairs(game.Workspace:GetDescendants()) do
		if V ~= nil and V:IsA("Texture") then
			if V.OffsetStudsU ~= 0 then
				local NewPosition = V.OffsetStudsV * 2.5
				V.OffsetStudsV =  V.OffsetStudsV + NewPosition
			elseif V.OffsetStudsV ~= 0 then
				local NewPosition = V.OffsetStudsU * 2.5
				V.OffsetStudsU =  V.OffsetStudsU + NewPosition
			end
		end
	end
end
--Main Functions--
TETeleport.OnServerInvoke = function(Player,TargetPosition)
	local Character = Player.Character or Player.CharacterAdded:Wait()
	local Humanoid = Character:WaitForChild("Humanoid")
	local RootPart = Character:WaitForChild("HumanoidRootPart")
	for I,V in pairs(game.Workspace:GetDescendants()) do
		if V ~= nil and V:IsA("Humanoid") and V ~= Humanoid then
			for Index,Track in pairs(V:GetPlayingAnimationTracks()) do
				local NewPosition = Track.TimePosition + .25
				if NewPosition >= Track.Length then
					Track.TimePosition = 0
					print("Skipped")
				else
					Track.TimePosition = NewPosition
					print("Skipped")
				end
			end
			local NewHumanoid = V
			local NewRootPart = V.Parent:WaitForChild("HumanoidRootPart")
			NewHumanoid.Running:Connect(function(Speed)
				if Speed > 0 then
					NewRootPart.CFrame = CFrame.new(0,math.random(5,50),0)
				else
					print("Stopped")
				end
			end)
		end
	end
	SkipSound()
	SkipTextureOffset()
	RootPart.CFrame = CFrame.new(TargetPosition)
end

When I Used It This Way, If One Player Was Running, The Script Would Move Every Player Even If Some Weren’t Moving. The Position Is Also Way Off From The Intended Position. And I Couldn’t Figure Out The Formula On How To Move Them Precisely. If Anyone Knows The Solution, I’d Really Love To Hear It, Thank You. :slight_smile:

1 Like

Also, This Is The Current State Of The Script, I Am So Stuck On This, That I Couldn’t Have It Contain The Falling, And Jumping Part Of It, I Am Really Sorry… :slightly_frowning_face:

Could you show a video of what is happening?

Maybe you could try AlignPosition constraints? They basically “tween” one object’s position to a specified one, by default anyway. There are a couple properties you could modify to determine how quick object A should reach object B.
At this moment, you’ll have to use either the command bar or scripts to change the properties due to an ongoing bug(?)