Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. local model = game.Workspace.Car --or whatever the path to the model of your car is
  2. local playerValue = game.Workspace.Car.StringValue
  3. local deleteButton = game.Workspace.Car.DeleteButton
  4. local button = script.Parent --or whatever the path to your button is
  5. local destination = Vector3.new(x, y, z) --the 3D coordinates of where you'd like the car to spawn
  6.  
  7. local function spawnCar(Clicker)
  8. model:MoveTo(destination) --use this if you want to move the car that's in the dealership
  9. model:Clone():MoveTo(destination) --use this if you want to make a copy of the car and move that
  10. playerValue.Value = Clicker.Name -- sets the person who clicked's name to the value.
  11. end
  12.  
  13. local function deleteCar(Clicker)
  14. if playerValue.Value == Click.Name then -- if the players name is the same as the owner's name
  15. model:Destroy() -- destroy the car if it is
  16. end
  17. end
  18.  
  19.  
  20. button.MouseClick:Connect(spawnCar) --notice it's "spawnCar", NOT "spawnCar()"
  21. deleteButton.MouseClick:Connect(deleteCar) -- notice it's "deleteCar", NOT "deleteCar()"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement