So i put a script in serverscriptservice and put this in there

 local Players = game:GetService("Players")

local LastTrainCF

local function onCharacterAdded(player)

while true do

wait(0.1)

  

local RootPart = player.HumanoidRootPart

local Ignore = player

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

local Hit, Position = workspace:FindPartOnRay(ray,Ignore)

if Hit.Name == "plat" then

print("Worked")

  

local Train = Hit

local TrainCF = Train.CFrame

LastTrainCF = Hit.CFrame

local Rel = TrainCF * LastTrainCF:Inverse()

RootPart.CFrame = Rel * RootPart.CFrame

  

end

end

end

  

local function onPlayerAdded(player)

player.CharacterAdded:Connect(onCharacterAdded)

end

  

  

Players.PlayerAdded:Connect(onPlayerAdded)

but this wont work can someone help?

5 comments

0

#1. list any output errors

0

#2, please put your code in a code block

0

there are no errors

0

it just wont work

0

Fixed it no need to help me anymore