I want to tp the seat occupant player, but when i tp it drags the seat with them . I tried making the humanoid sit false and destroy the weld but then it doesnt Tp . Anyone know how to fix this?
local Ring = script.Parent.Parent
local Work = false
local function CheckForPlrs()
print("Fire")
local Player1 = script.Parent.Parent.TpStart.Seat1.Occupant
local Player2 = script.Parent.Parent.TpStart.Seat1.Occupant
if Player1 ~= nil and Player2 ~= nil and script.Parent.Parent.Using.Value == false then
script.Parent.Parent.Using.Value = true
print(Player1,Player2)
script.Parent.Display.Timer.Text = "1"
script.Parent.Display.Timer.Visible = true
for i = 1,5 do
wait(1)
print(i)
script.Parent.Display.Timer.Text = tostring(i)
end
print("Done")
Player2.Parent.HumanoidRootPart.CFrame = Ring.TpEnd.Part2.CFrame
Player1.Parent.HumanoidRootPart.CFrame = Ring.TpEnd.Part1.CFrame
game.ReplicatedStorage.GameRemotes.Placement:FireClient(game.Players:GetPlayerFromCharacter(Player1.Parent),Ring.TpEnd.Part1Camera,2)
game.ReplicatedStorage.GameRemotes.Placement:FireClient(game.Players:GetPlayerFromCharacter(Player2.Parent),Ring.TpEnd.Part2Camera,2)
elseif (Player1 == nil or Player2 == nil)and script.Parent.Parent.Using.Value == true then
script.Parent.Parent.Using.Value = true
script.Parent.Display.Timer.Text = "1"
script.Parent.Display.Timer.Visible = false
end
end
script.Parent.Parent.TpStart.Seat1.Changed:Connect(CheckForPlrs)
script.Parent.Parent.TpStart.Seat2.Changed:Connect(CheckForPlrs)
script.Parent.Parent.TpStart.Seat1.Touched:Connect(CheckForPlrs)
script.Parent.Parent.TpStart.Seat2.Touched:Connect(CheckForPlrs)
local function CheckForPlrs()
print("Fire")
local Player1 = script.Parent.Parent.TpStart.Seat1.Occupant
local Player2 = script.Parent.Parent.TpStart.Seat1.Occupant
if Player1 ~= nil and Player2 ~= nil and script.Parent.Parent.Using.Value == false then
script.Parent.Parent.Using.Value = true
print(Player1,Player2)
script.Parent.Display.Timer.Text = "1"
script.Parent.Display.Timer.Visible = true
for i = 1,5 do
wait(1)
print(i)
script.Parent.Display.Timer.Text = tostring(i)
end
print("Done")
if Player2 and Player1 then
Player1:WaitForChild("Humanoid").Jump = true
Player2:WaitForChild("Humanoid").Jump = true
end
Player2.Parent.HumanoidRootPart.CFrame = Ring.TpEnd.Part2.CFrame
Player1.Parent.HumanoidRootPart.CFrame = Ring.TpEnd.Part1.CFrame
game.ReplicatedStorage.GameRemotes.Placement:FireClient(game.Players:GetPlayerFromCharacter(Player1.Parent),Ring.TpEnd.Part1Camera,2)
game.ReplicatedStorage.GameRemotes.Placement:FireClient(game.Players:GetPlayerFromCharacter(Player2.Parent),Ring.TpEnd.Part2Camera,2)
elseif (Player1 == nil or Player2 == nil)and script.Parent.Parent.Using.Value == true then
script.Parent.Parent.Using.Value = true
script.Parent.Display.Timer.Text = "1"
script.Parent.Display.Timer.Visible = false
end
end
oops, sorry i skimmed over it and assumed you wanted a way to position it locally in a sense. What you can do I suppose is unweld it (sets occupant to nil) but before u do that make a local varaible that stores the player data form the occupant’s cframe (this will create a unsized memory address) then from there we can simply reset its cframe from there
local function CheckForPlrs()
print("Fire")
local Player1 = script.Parent.Parent.TpStart.Seat1.Occupant
local Player2 = script.Parent.Parent.TpStart.Seat1.Occupant
if Player1 ~= nil and Player2 ~= nil and script.Parent.Parent.Using.Value == false then
script.Parent.Parent.Using.Value = true
print(Player1,Player2)
script.Parent.Display.Timer.Text = "1"
script.Parent.Display.Timer.Visible = true
for i = 1,5 do
wait(1)
print(i)
script.Parent.Display.Timer.Text = tostring(i)
end
print("Done")
if Player2 and Player1 then
script.Parent.Parent.TpStart.Seat1.Occupant = nil
end
Player2.Parent.HumanoidRootPart.CFrame = Ring.TpEnd.Part2.CFrame
Player1.Parent.HumanoidRootPart.CFrame = Ring.TpEnd.Part1.CFrame
game.ReplicatedStorage.GameRemotes.Placement:FireClient(game.Players:GetPlayerFromCharacter(Player1.Parent),Ring.TpEnd.Part1Camera,2)
game.ReplicatedStorage.GameRemotes.Placement:FireClient(game.Players:GetPlayerFromCharacter(Player2.Parent),Ring.TpEnd.Part2Camera,2)
elseif (Player1 == nil or Player2 == nil)and script.Parent.Parent.Using.Value == true then
script.Parent.Parent.Using.Value = true
script.Parent.Display.Timer.Text = "1"
script.Parent.Display.Timer.Visible = false
end
end
the code your using is funky and has different players listed under 1 seat
local Player1 = script.Parent.Parent.TpStart.Seat1.Occupant
local Player2 = script.Parent.Parent.TpStart.Seat1.Occupant
I dont think thats correct and I really dont know why you would make them sit to start that you could use a ready up button or something instead of that to evade this
Exactly what I meant bobo. I want to combine the rotational matrix from (CFrame.new(positionToTeleport) - player.Character.HumanoidRootPart.CFrame)
with the humanoidrootsparts position derived from its cframe. Sorry ;(