UsernameRTX

Vehicle Simulator FindPlayersCar Function

May 14th, 2020 (edited)
264
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local LocalPlayer = game.Players.LocalPlayer
  2. local MyCar
  3. function FindPlayersCar()
  4.     for _, v in pairs(workspace.Vehicles:GetChildren()) do
  5.         local ow = v:FindFirstChild("owner")
  6.         local own = ow and ow.Value
  7.         if own == LocalPlayer.Name then
  8.             MyCar = v
  9.             return v
  10.         end
  11.     end
  12. end
  13. MyCar = FindPlayersCar()
RAW Paste Data