This script is server sided and runs fully without errors or anything in console. When using PivotTo()
in other scripts (with comparably similar code) it works fine. The character teleports to the car but the car doesn’t teleport to mp
. Here is the code with some parts omitted. Just remember that no warnings or errors get outputted to console, and everything is triggered via proximityprompt.
local p = script.Parent.Torso.Prompt
local r = script.Parent.Head.Prompt
local cs = game.Workspace.Map.Buildings.CarShop.Placepart
local ss = game:GetService("ServerStorage"):WaitForChild("Cars")
local chs = game:GetService("Chat")
local guy = script.Parent
local function oporem()
local ya = cs:FindFirstChild("Open")
if ya then
return "Open"
else
return "Occupied"
end
end
-- proximityprompt trigger
if mp then
plr:WaitForChild("leaderstats").Cash.Value = plr:WaitForChild("leaderstats").Cash.Value - p.Cost.Value
guy.Torso.Audio:Play()
mp.Name = "Occupied"
local nc = workspace.Map.Misc.cars:FindFirstChild(plr.DisplayName.."'s car")
nc:PivotTo(mp:GetPivot())
local char = plr.Character or plr.CharacterAdded:Wait()
char:PivotTo(nc.DriveSeat.CFrame + Vector3.new(0, 1, 0))
wait(5)
mp.Name = "Open"
else
Any help would be appreciated