Joriangames

CarSpawner script

May 3rd, 2021 (edited)
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. --Thanks for using this script
  2. --This script is made by Joriangames/Problox Studio Scripts
  3. --Want to know how to use this and script explanation?
  4. --Watch my tutorial: https://youtu.be/2GGmbc6BKi0
  5. local carsFolder = game.ReplicatedStorage.Cars
  6. local carEvent = game.ReplicatedStorage.CarEvent
  7. print("carscript is ready to use")
  8.  
  9. carEvent.OnServerEvent:Connect(function(plr, carName)
  10.     local clone = carsFolder:FindFirstChild(carName):Clone()
  11.     clone.Parent = workspace
  12.     clone:SetPrimaryPartCFrame(plr.Character.HumanoidRootPart.CFrame + Vector3.new(0,8,0))
  13.     clone:MakeJoints()
  14. end)
Add Comment
Please, Sign In to add comment