Advertisement
Joriangames

SpawnHandler (localscript)

May 3rd, 2021
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 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 toggle = script.Parent.Toggle
  6. local frame = script.Parent.Frame
  7. local carsFr = frame.Cars
  8. local carEvent = game.ReplicatedStorage.CarEvent
  9.  
  10. toggle.MouseButton1Click:Connect(function()
  11.     if frame.Visible == true then
  12.         frame.Visible = false
  13.     else
  14.         frame.Visible = true
  15.     end
  16. end)
  17.  
  18. carsFr.Lambo.MouseButton1Click:Connect(function()
  19.     local carName = "Lambo"
  20.     carEvent:FireServer(carName)
  21.     frame.Visible = false
  22. end)
  23.  
  24. carsFr.Jeep.MouseButton1Click:Connect(function()
  25.     local carName = "Jeep"
  26.     carEvent:FireServer(carName)
  27.     frame.Visible = false
  28. end)
  29.  
  30. carsFr.Tesla.MouseButton1Click:Connect(function()
  31.     local carName = "Tesla"
  32.     carEvent:FireServer(carName)
  33.     frame.Visible = false
  34. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement