Jailbreak train platform system?

Thanks so much. Really helped me out. I noticed that if there is something blocking the ray from hitting the “RaftTop” it won’t move you.

Here is what I did to stop that.

--Replace Ignore with this.
local Whitelist = {} -- Table of Every "RaftTop"  (You could just make a model or folder for it.)

local ray = Ray.new(RootPart.CFrame.p,Vector3.new(0,-50,0))

local Hit, Position, Normal, Material = workspace:FindPartOnRayWithWhitelist(ray,Whitelist)
14 Likes

Hello there! I have been struggling to get this script working properly. I have been testing this out on a boat witch contains of some models not a part. I have not figured out how to get it working and I had been glad to get some help with my problem, since i am not a professional scripter. Every little help works!

2 Likes

It only works if the model is being Cframed.

2 Likes

When I did the improvement. was the game sending many error messages and didn’t stop. The “player” error was a nil value, and when I replaced the variable with “player” it didn’t work.


1 Like

Like below, you have to specify what the player is.

local Players = game:GetService(“Players”)
local player = game.Players.LocalPlayer

1 Like

How do I specify what the player is so everyone who touches it gets Cframed with it? keep in mind that I am not a professional scripter.

1 Like

Try on touched, otherwise i recommend making it a local script inside of the players starter player scripts.

2 Likes

Hey, thank you a lot. this worked and I appreciate for your help.

2 Likes

How would that work? Roblox still tries to keep the player onto the platform.

1 Like

There’s a lot of good information on this thread.

I was able to get the client to stand/move on a platform smoothly, but I’m having difficulty replicating other clients positions without them lagging behind and stuttering.

On the server after every time I CFrame the platform do I send the clients the relative CFrame like below?

local TrainCF = TrainCF 
local Rel = TrainCF * LastTrainCF:Inverse()

RemoteEvent:FireAllClients(Rel)
LastTrainCF = TrainCF
5 Likes

I think this is a problem with humanoid replication, as i renmeber before the new “walking on moving platforms” came out with the replication fix, users would allways lag behind the platform.

1 Like

Well the “walking on moving platforms” is for unanchored parts.

What I posted was all CFraming

Does anybody have any ideas on how to stop the jitter of other players? Only the localplayer looks stable, everybody else thats on the platform is all over the place

2 Likes

Doubt theres a simple way other than making your own character replication system while the user is on the platform.

1 Like

If you look further up in this thread, tyridge77 gave an example of what he did.

5 Likes

I already saw that, I implemented it and it still happens all it does it decrease the amount of jittering but its still very noticeable, I went to jailbreak to see how their system is working and they are having the same issue, other players on the train jitter a little bit as well.

1 Like

Apologies for the (somewhat) late reply.

This is a pretty bad an inefficient way of replicating changes - make it so the client is entirely responsible for their own rotation and trust that, as they have network ownership of their parts - you’ll never keep up entirely if you do it from the server down.

3 Likes

No need for an apology I appreciate the response and I’ll take your advice.

I’ve seen tyridge77’s system in use and it works well albeit its some extra steps

2 Likes

Hey, sorry for necroposting but I feel like this is the best time to do this.

So I’ve got this issue with your script because I have a plane model that has multiple parts. However, the plane model doesn’t have one static part (RaftPart) so it’s teleporting me around like crazy.

Shown here:
https://i.gyazo.com/f607b2e739cb9bb0065ff3fd591dcb1f.mp4

Here’s my code (It’s modified to suit my needs):

local Players = game:GetService("Players")
local player = game.Players.LocalPlayer
local RunService = game:GetService('RunService')

local LastTrainCFrame

local Function
local Function2


Function = RunService.Heartbeat:Connect(function()
	local RootPart = player.Character.HumanoidRootPart
	local Ignore = player.Character
	local ray = Ray.new(RootPart.CFrame.p, Vector3.new(0,-500,0))
	local Hit, Position, Normal, Material = workspace:FindPartOnRay(ray,Ignore)
	if Hit and Hit:IsDescendantOf(workspace.Planes) then
		local Train = Hit
		if not LastTrainCFrame then
			LastTrainCFrame = Train.CFrame
		end
		local TrainCF = Train.CFrame 
		local Rel = TrainCF * LastTrainCFrame:inverse()
		LastTrainCFrame = Train.CFrame
		RootPart.CFrame = Rel * RootPart.CFrame
	else
		LastTrainCFrame = nil
	end
	
	if not Function2 then
		Function2 = player.Character.Humanoid.Died:Connect(function()
			Function:Disconnect()
			Function2:Disconnect()
		end)
	end
end)

Any idea on how to fix this? (btw it’s late for me so i will be going to bed after posting this)

3 Likes

To switch static parts you have to convert Rel from the local space of the old Train part into the new Train part.

4 Likes