Advertisement
BINO2002

Untitled

Jan 10th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.23 KB | None | 0 0
  1.  
  2. function AlertCreator()
  3. for i,v in ipairs(game.Players:GetPlayers()) do
  4. if v.userId == game.CreatorId then
  5. if script:findFirstChild('AllowThirdPartySalesNotice') then
  6. if not v.PlayerGui:findFirstChild('AllowThirdPartySalesNotice') then
  7. script.AllowThirdPartySalesNotice:Clone().Parent = v.PlayerGui
  8. end
  9. end
  10. end
  11. end
  12. end
  13. wait(.1)
  14. if not workspace.AllowThirdPartySales then AlertCreator() end
  15. KartAssetId = 193064098 -- Don't mess with this or your warranty is void LOL SO FUNNEH!!
  16. Ids = {
  17. ['G'] = 306060116,
  18. ['C'] = 336722242,
  19. ['M'] = 336724563,
  20. ['I'] = 336725370,
  21. ['R'] = 336726773,
  22. }
  23.  
  24. count = 0
  25. repeat wait() count = count+1 until count >= 5
  26.  
  27. -- define variables
  28. Kart = script.Parent
  29. Steeringwheel = Kart.SteeringWheel
  30. Configurations = Kart.Configurations
  31. BodyColor = Configurations.BodyColor
  32. SeatColor = Configurations.SeatColor
  33. ChassisColor = Configurations.ChassisColor
  34. Number = Configurations.Number
  35.  
  36. Body = Kart.Body
  37. Chassis = Kart.Chassis
  38. Seat = Kart.Seat
  39. Tires = Kart.Tires
  40. NumberDisplay = Seat.SeatWedge.SurfaceGui.TextLabel
  41. VehicleSeat = Seat.VehicleSeat
  42. Sounds = Kart.SteeringWheel
  43. Engine = Sounds.Engine
  44. Horn = Sounds.Horn
  45.  
  46. MainEvent = Kart.RemoteEvents:WaitForChild('MainEvent')
  47. CS = VehicleSeat.ControllerScript -- we'll use this in-case anything were to happen where we'd lose the ControllerScript
  48.  
  49.  
  50. repeat wait() until Kart:FindFirstChild("Version")
  51. local version = Kart.Version.Value
  52.  
  53. local IsInvisible = false
  54. local IsMLGMode = false
  55. local mode = 1
  56.  
  57. KartStorage = {}
  58. CharacterStorage = {}
  59. CreatedItems = {}
  60.  
  61. function GetCurrentVal(color)
  62. for i = 0, 127 do
  63. if BrickColor.palette(i) == color then
  64. return i
  65. end
  66. end
  67. end
  68.  
  69. function GetColor3(r,g,b)
  70. return Color3.new(r/255,g/255,b/255)
  71. end
  72.  
  73. function GetNumberSequence(start,stop)
  74. return NumberSequence.new(start,stop)
  75. end
  76.  
  77. function GetNumberRange(start,stop)
  78. return NumberRange.new(start,stop)
  79. end
  80.  
  81. function EliteMode()
  82. if mode == 1 then
  83. prevColor = BodyColor.Value
  84. prevMaterial = Body:GetChildren()[1].Material
  85. for i,v in ipairs(Body:GetChildren()) do
  86. v.BrickColor = BrickColor.new('Deep orange')
  87. v.Reflectance = 0.5
  88. v.Material = Enum.Material.Neon
  89. end
  90. end
  91. end
  92.  
  93. function UnEliteMode()
  94. for i,v in ipairs(Body:GetChildren()) do
  95. v.BrickColor = prevColor
  96. v.Reflectance = 0
  97. v.Material = prevMaterial
  98. end
  99. end
  100.  
  101. function CreateMLGParticles()
  102. -- MLG Particles
  103. local P1 = Instance.new('ParticleEmitter')
  104. P1.Color = ColorSequence.new(GetColor3(255,255,255),GetColor3(255,255,255))
  105. P1.LightEmission = 1
  106. P1.Size = GetNumberSequence(1,1)
  107. P1.Texture = 'http://www.roblox.com/asset/?id=201320071'
  108. P1.Transparency = GetNumberSequence(0.8,.8)
  109. P1.ZOffset = 0
  110. P1.Acceleration = Vector3.new(0,0,0)
  111. P1.Drag = 0
  112. P1.LockedToPart = false
  113. P1.VelocityInheritance = 0
  114. P1.EmissionDirection = Enum.NormalId.Top
  115. P1.Enabled = true
  116. P1.Lifetime = GetNumberRange(1,1)
  117. P1.Rate = math.random(12,50)
  118. P1.Rotation = GetNumberRange(0,0)
  119. P1.RotSpeed = GetNumberRange(0,0)
  120. P1.Speed = GetNumberRange(1,1)
  121. P1.VelocitySpread = 500
  122.  
  123. local P2 = Instance.new('ParticleEmitter')
  124. P2.Color = ColorSequence.new(GetColor3(127,225,36),GetColor3(60,143,29))
  125. P2.LightEmission = 1
  126. P2.Size = GetNumberSequence(1,1)
  127. P2.Texture = 'http://www.roblox.com/asset/?id=208253379'
  128. P2.Transparency = GetNumberSequence(.8,.8)
  129. P2.ZOffset = 0
  130. P2.Acceleration = Vector3.new(0,0,0)
  131. P2.Drag = 0
  132. P2.LockedToPart = false
  133. P2.VelocityInheritance = 0
  134. P2.EmissionDirection = Enum.NormalId.Top
  135. P2.Enabled = true
  136. P2.Lifetime = GetNumberRange(50,50)
  137. P2.Rate = math.random(12,50)
  138. P2.Rotation = GetNumberRange(0,0)
  139. P2.RotSpeed = GetNumberRange(0,0)
  140. P2.Speed = GetNumberRange(1,1)
  141. P2.VelocitySpread = 500
  142.  
  143. local P3 = Instance.new('ParticleEmitter')
  144. P3.Color = ColorSequence.new(GetColor3(255,255,255),GetColor3(255,255,255))
  145. P3.LightEmission = 1
  146. P3.Size = GetNumberSequence(1,1)
  147. P3.Texture = 'http://www.roblox.com/asset/?id=179012130'
  148. P3.Transparency = GetNumberSequence(0.8,.8)
  149. P3.ZOffset = 0
  150. P3.Acceleration = Vector3.new(0,0,0)
  151. P3.Drag = 0
  152. P3.LockedToPart = false
  153. P3.VelocityInheritance = 0
  154. P3.EmissionDirection = Enum.NormalId.Top
  155. P3.Enabled = true
  156. P3.Lifetime = GetNumberRange(50,50)
  157. P3.Rate = math.random(12,50)
  158. P3.Rotation = GetNumberRange(0,0)
  159. P3.RotSpeed = GetNumberRange(0,0)
  160. P3.Speed = GetNumberRange(1,1)
  161. P3.VelocitySpread = 500
  162.  
  163. local P4 = Instance.new('ParticleEmitter')
  164. P4.Color = ColorSequence.new(GetColor3(127, 225, 36),GetColor3(60, 143, 29))
  165. P4.LightEmission = 1
  166. P4.Size = GetNumberSequence(1,1)
  167. P4.Texture = 'http://www.roblox.com/asset/?id=216633597'
  168. P4.Transparency = GetNumberSequence(0.8,.8)
  169. P4.ZOffset = 0
  170. P4.Acceleration = Vector3.new(0,0,0)
  171. P4.Drag = 0
  172. P4.LockedToPart = false
  173. P4.VelocityInheritance = 0
  174. P4.EmissionDirection = Enum.NormalId.Top
  175. P4.Enabled = true
  176. P4.Lifetime = GetNumberRange(50,50)
  177. P4.Rate = math.random(12,50)
  178. P4.Rotation = GetNumberRange(0,0)
  179. P4.RotSpeed = GetNumberRange(0,0)
  180. P4.Speed = GetNumberRange(1,1)
  181. P4.VelocitySpread = 500
  182.  
  183. local P5 = Instance.new('ParticleEmitter')
  184. P5.Color = ColorSequence.new(GetColor3(255, 255, 255),GetColor3(255, 255, 255))
  185. P5.LightEmission = 1
  186. P5.Size = GetNumberSequence(1,1)
  187. P5.Texture = 'http://www.roblox.com/asset/?id=218792778'
  188. P5.Transparency = GetNumberSequence(0.8,.8)
  189. P5.ZOffset = 0
  190. P5.Acceleration = Vector3.new(0,0,0)
  191. P5.Drag = 0
  192. P5.LockedToPart = false
  193. P5.VelocityInheritance = 0
  194. P5.EmissionDirection = Enum.NormalId.Top
  195. P5.Enabled = true
  196. P5.Lifetime = GetNumberRange(50,50)
  197. P5.Rate = math.random(12,50)
  198. P5.Rotation = GetNumberRange(0,0)
  199. P5.RotSpeed = GetNumberRange(0,0)
  200. P5.Speed = GetNumberRange(1,1)
  201. P5.VelocitySpread = 500
  202.  
  203. local P6 = Instance.new('ParticleEmitter')
  204. P6.Color = ColorSequence.new(GetColor3(255, 255, 255),GetColor3(255, 255, 255))
  205. P6.LightEmission = 1
  206. P6.Size = GetNumberSequence(1,1)
  207. P6.Texture = 'http://www.roblox.com/asset/?id=157979926'
  208. P6.Transparency = GetNumberSequence(0.8,.8)
  209. P6.ZOffset = 0
  210. P6.Acceleration = Vector3.new(0,0,0)
  211. P6.Drag = 0
  212. P6.LockedToPart = false
  213. P6.VelocityInheritance = 0
  214. P6.EmissionDirection = Enum.NormalId.Top
  215. P6.Enabled = true
  216. P6.Lifetime = GetNumberRange(1,1)
  217. P6.Rate = math.random(12,50)
  218. P6.Rotation = GetNumberRange(0,0)
  219. P6.RotSpeed = GetNumberRange(0,0)
  220. P6.Speed = GetNumberRange(1,1)
  221. P6.VelocitySpread = 500
  222.  
  223.  
  224. local MLGEffects = {P1,P2,P3,P4,P5,P6}
  225. return MLGEffects
  226. end
  227. MLGEffects = CreateMLGParticles()
  228. function MLGMode(plr,val)
  229. if val then
  230. for i,v in ipairs(plr.Character:GetChildren()) do
  231. if v:IsA('Hat') or v:IsA('Tool') then
  232. table.insert(CharacterStorage,v:Clone())
  233. v:Destroy()
  234. end
  235. end
  236. for i,v in ipairs(CreatedItems) do
  237. v:Destroy()
  238. end
  239. CreatedItems = {}
  240. local MLGShades = Instance.new('Hat')
  241. MLGShades.AttachmentForward = Vector3.new(0,0,-1)
  242. MLGShades.AttachmentPos = Vector3.new(0,.38,.1)
  243. MLGShades.AttachmentRight = Vector3.new(1,0,0)
  244. MLGShades.AttachmentUp = Vector3.new(0,1,0)
  245. local ShadesHandle = Instance.new('Part',MLGShades)
  246. ShadesHandle.Name = 'Handle'
  247. ShadesHandle.FormFactor = Enum.FormFactor.Custom
  248. ShadesHandle.CanCollide = true
  249. ShadesHandle.Size = Vector3.new(1,1,1)
  250. ShadesHandle.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  251. ShadesHandle.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  252. ShadesHandle.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  253. ShadesHandle.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  254. ShadesHandle.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  255. ShadesHandle.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  256. local MLGMesh = Instance.new('SpecialMesh',ShadesHandle)
  257. MLGMesh.MeshId = 'http://www.roblox.com/asset/?id=121910245'
  258. MLGMesh.MeshType = Enum.MeshType.FileMesh
  259. MLGMesh.Offset = Vector3.new(0,0,0)
  260. MLGMesh.Scale = Vector3.new(.7,.5,.7)
  261. MLGMesh.TextureId = 'http://www.roblox.com/asset/?id=121947422'
  262. MLGMesh.VertexColor = Vector3.new(1,1,1)
  263.  
  264. local ObeyHat = Instance.new('Hat')
  265. ObeyHat.AttachmentForward = Vector3.new(0,0,-1)
  266. ObeyHat.AttachmentPos = Vector3.new(0,-.15,0)
  267. ObeyHat.AttachmentRight = Vector3.new(1,0,0)
  268. ObeyHat.AttachmentUp = Vector3.new(0,1,0)
  269. local HatHandle = Instance.new('Part',ObeyHat)
  270. HatHandle.Name = 'Handle'
  271. HatHandle.FormFactor = Enum.FormFactor.Custom
  272. HatHandle.CanCollide = true
  273. HatHandle.Size = Vector3.new(1,1,1)
  274. HatHandle.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  275. HatHandle.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  276. HatHandle.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  277. HatHandle.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  278. HatHandle.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  279. HatHandle.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  280. local HatMesh = Instance.new('SpecialMesh',HatHandle)
  281. HatMesh.MeshId = 'http://www.roblox.com/asset/?id=13030731'
  282. HatMesh.MeshType = Enum.MeshType.FileMesh
  283. HatMesh.Offset = Vector3.new(0,0,0)
  284. HatMesh.Scale = Vector3.new(.95,.95,.95)
  285. HatMesh.TextureId = 'http://www.roblox.com/asset/?id=70262300'
  286. HatMesh.VertexColor = Vector3.new(1,1,1)
  287.  
  288. ObeyHat.Parent,MLGShades.Parent = plr.Character,plr.Character
  289. table.insert(CreatedItems,MLGShades)
  290. table.insert(CreatedItems,ObeyHat)
  291. for i,v in ipairs(MLGEffects) do
  292. local Clone = v:Clone()
  293. Clone.Parent = Kart.PrimaryPart
  294. table.insert(CreatedItems,Clone)
  295. end
  296. elseif not val then
  297. for i,v in ipairs(CreatedItems) do
  298. v:Destroy()
  299. end
  300. CreatedItems = {}
  301. for i,v in ipairs(CharacterStorage) do
  302. v.Parent = plr.Character
  303. CharacterStorage = {}
  304. end
  305. end
  306. end
  307.  
  308. function MakeInstancesInvisible(par,val)
  309. for i,v in ipairs(par:GetChildren()) do
  310. if v:IsA('BasePart') or v:IsA('Decal') then
  311. if v.Name ~= 'HumanoidRootPart' then
  312. v.Transparency = val
  313. MakeInstancesInvisible(v,val)
  314. end
  315. elseif v:IsA('SurfaceGui') then
  316. if val == 1 then
  317. v.Enabled = false
  318. else
  319. v.Enabled = true
  320. end
  321. elseif not v:IsA('BasePart') and not v:IsA('Decal') and not v:IsA('SurfaceGui') then
  322. MakeInstancesInvisible(v,val)
  323. end
  324. end
  325. end
  326.  
  327. function InvisibleFunction(plr)
  328. for i,v in ipairs(CreatedItems) do
  329. v:Destroy()
  330. end
  331. CreatedItems = {}
  332. if not IsInvisible then
  333. MakeInstancesInvisible(Kart,1)
  334. for i,v in ipairs(plr.Character:GetChildren()) do
  335. if v:IsA('Hat') or v:IsA('Tool') then
  336. table.insert(CharacterStorage,v:Clone())
  337. v:Destroy()
  338. end
  339. end
  340. MakeInstancesInvisible(plr.Character,1)
  341. IsInvisible = true
  342. else
  343. MakeInstancesInvisible(Kart,0)
  344. for i,v in ipairs(CharacterStorage) do
  345. v.Parent = plr.Character
  346. CharacterStorage = {}
  347. end
  348. MakeInstancesInvisible(plr.Character,0)
  349. IsInvisible = false
  350. end
  351. end
  352.  
  353. function NextColor()
  354. local CurrentVal = GetCurrentVal(Configurations.BodyColor.Value)
  355. local NewVal = 0
  356. if CurrentVal < 127 then
  357. NewVal = CurrentVal+1
  358. else
  359. NewVal = 0
  360. end
  361. Configurations.BodyColor.Value = BrickColor.palette(NewVal)
  362. end
  363.  
  364. function PrevColor()
  365. local CurrentVal = GetCurrentVal(Configurations.BodyColor.Value)
  366. local NewVal = 0
  367. if CurrentVal > 0 then
  368. NewVal = CurrentVal-1
  369. else
  370. NewVal = 127
  371. end
  372. Configurations.BodyColor.Value = BrickColor.palette(NewVal)
  373. end
  374.  
  375. function FlipKart()
  376. local x, y, z, RX,RY,RZ = Kart.PrimaryPart.CFrame.x,Kart.PrimaryPart.CFrame.y,Kart.PrimaryPart.CFrame.z,0,0,0
  377. Kart:SetPrimaryPartCFrame(CFrame.new(x,y,z)*CFrame.Angles(RX,RY,RZ))
  378. end
  379.  
  380. function LoadLatestVersion()
  381. local LatestVersion = game:GetService("InsertService"):LoadAsset(KartAssetId)
  382. for _,v in pairs(LatestVersion:GetChildren()) do
  383. if v:IsA('Model') then
  384. LatestVersion = v
  385. end
  386. end
  387. if LatestVersion and LatestVersion:FindFirstChild("Version") and LatestVersion.Version:IsA("IntValue") and LatestVersion.Version.Value > version then
  388. LatestVersion:MakeJoints()
  389. LatestVersion.Parent = Kart.Parent
  390. LatestVersion:SetPrimaryPartCFrame(Kart.PrimaryPart.CFrame)
  391. LatestVersion:MakeJoints()
  392. LatestVersion.Configurations.BodyColor.Value = Kart.Configurations.BodyColor.Value
  393. LatestVersion.Configurations.ChassisColor.Value = Kart.Configurations.ChassisColor.Value
  394. LatestVersion.Configurations.Number.Value = Kart.Configurations.Number.Value
  395. LatestVersion.Configurations.SeatColor.Value = Kart.Configurations.SeatColor.Value
  396. Kart:Destroy()
  397. end
  398. end
  399. LoadLatestVersion()
  400.  
  401.  
  402. vals = {
  403. BodyColor,
  404. SeatColor,
  405. ChassisColor,
  406. Number
  407. }
  408.  
  409. AlreadyBugged = {} -- we'll use this table to keep track of those we already asked if they'd like to purchase the go kart, so we don't bug 'em. :)
  410.  
  411. function ColorBody(color)
  412. for i,v in pairs(Body:GetChildren()) do
  413. v.BrickColor = color
  414. end
  415. end
  416.  
  417. function ColorSeat(color)
  418. for i,v in pairs(Seat:GetChildren()) do
  419. v.BrickColor = color
  420. end
  421. end
  422.  
  423. function ColorChassis(color)
  424. for i,v in pairs(Chassis:GetChildren()) do
  425. v.BrickColor = color
  426. end
  427. end
  428.  
  429. function ChangeNumber(val)
  430. NumberDisplay.Text = val
  431. end
  432.  
  433. actions = {
  434. [BodyColor] = function(val)
  435. ColorBody(val)
  436. end,
  437. [SeatColor] = function(val)
  438. ColorSeat(val)
  439. end,
  440. [ChassisColor] = function(val)
  441. ColorChassis(val)
  442. end,
  443. [Number] = function(val)
  444. ChangeNumber(val)
  445. end,
  446. }
  447.  
  448. for _,v in ipairs(vals) do
  449. actions[v](v.Value)
  450. end
  451.  
  452. for _,v in ipairs(vals) do
  453. v.Changed:connect(function(change)
  454. actions[v](change)
  455. end)
  456. end
  457.  
  458. function CheckIfAlreadyBugged(plr)
  459. for i,v in ipairs(AlreadyBugged) do
  460. if v == plr then
  461. return true
  462. end
  463. end
  464. end
  465.  
  466. AskedToPurchaseGas = {}
  467.  
  468. function YesOrNo(plr)
  469. for i,v in ipairs(AskedToPurchaseGas) do
  470. if v == plr then
  471. return true
  472. end
  473. end
  474. end
  475.  
  476. function StartSoundPitch(hu)
  477. while wait() and hu and hu.Sit == true do
  478. if VehicleSeat.Velocity.magnitude < VehicleSeat.MaxSpeed - 20 then
  479. Engine.Pitch = math.rad(VehicleSeat.Velocity.magnitude and (80+VehicleSeat.Velocity.magnitude))/1.6
  480. end
  481. end
  482. end
  483.  
  484. VehicleSeat.ChildAdded:connect(function(child)
  485. if not workspace.AllowThirdPartySales then AlertCreator() end
  486. if child:IsA('Weld') then
  487. if VehicleSeat:findFirstChild('ControllerScript') == nil then
  488. CS:Clone().Parent = VehicleSeat
  489. end
  490. local char = child.Part1.Parent
  491. PlrFromChar = game.Players:GetPlayerFromCharacter(char)
  492. local hu = char.Humanoid
  493. delay(0,function()StartSoundPitch(hu)end)
  494. Engine:Play()
  495. KartVal = Instance.new('ObjectValue',PlrFromChar)
  496. KartVal.Name = 'CodeWrighterKartDetection'
  497. KartVal.Value = Kart
  498. cs = VehicleSeat.ControllerScript
  499. cs.Parent = PlrFromChar.PlayerGui
  500. cs.Disabled = false
  501. if PlrFromChar.userId > -2 then
  502. if PlrFromChar:findFirstChild('Elite') then
  503. EliteMode()
  504. end
  505. if not game:GetService('MarketplaceService'):PlayerOwnsAsset(PlrFromChar,Ids['G']) then
  506. if PlrFromChar.MembershipType == Enum.MembershipType.None then
  507. game:GetService('MarketplaceService'):PromptPurchase(PlrFromChar,Ids['G'],false,Enum.CurrencyType.Tix)
  508. --table.insert(AskedToPurchaseGas,PlrFromChar)
  509. else
  510. game:GetService('MarketplaceService'):PromptPurchase(PlrFromChar,Ids['G'],false,Enum.CurrencyType.Tix)
  511. --table.insert(AskedToPurchaseGas,PlrFromChar)
  512. end
  513. end
  514. end
  515. end
  516. end)
  517.  
  518. VehicleSeat.ChildRemoved:connect(function(child)
  519. if child:IsA('Weld') then
  520. cs = PlrFromChar.PlayerGui.ControllerScript
  521. local GUI = PlrFromChar.PlayerGui.ControlsHUD
  522. GUI.Parent = cs
  523. local KartVal = PlrFromChar:findFirstChild('CodeWrighterKartDetection')
  524. if KartVal then
  525. KartVal:Destroy()
  526. end
  527. if IsInvisible then
  528. InvisibleFunction(PlrFromChar)
  529. end
  530. if IsMLGMode then
  531. MLGMode(PlrFromChar,false)
  532. IsMLGMode = false
  533. end
  534. UnEliteMode()
  535. cs.Disabled = true
  536. cs.Parent = VehicleSeat
  537. Engine:Stop()
  538. end
  539. end)
  540. repeat wait() until Kart:findFirstChild('ClickDetector')
  541. Kart.ClickDetector.MouseClick:connect(function(plr)
  542. if plr.userId > -2 and not game:GetService('MarketplaceService'):PlayerOwnsAsset(plr,KartAssetId) then
  543. --if not CheckIfAlreadyBugged(plr) then
  544. game:GetService('MarketplaceService'):PromptPurchase(plr,KartAssetId)
  545. --table.insert(AlreadyBugged,plr)
  546. --end
  547. end
  548. end)
  549.  
  550. MainEvent.OnServerEvent:connect(function(plr,action,ID)
  551. if action == 'PlayHorn' then
  552. Horn:Play()
  553. elseif action == 'StopHorn' then
  554. Horn:Stop()
  555. elseif action == 'Invisibility' then
  556. if game:GetService('MarketplaceService'):PlayerOwnsAsset(plr,Ids['I']) then
  557. -- invisible
  558. InvisibleFunction(plr)
  559. else
  560. game:GetService('MarketplaceService'):PromptPurchase(plr,Ids['I'])
  561. end
  562. elseif action == 'Flip' then
  563. -- flip kart
  564. FlipKart()
  565. elseif action == 'PrevColor' then
  566. -- previous color
  567. if game:GetService('MarketplaceService'):PlayerOwnsAsset(plr,Ids['C']) then
  568. PrevColor()
  569. else
  570. game:GetService('MarketplaceService'):PromptPurchase(plr,Ids['C'])
  571. end
  572. elseif action == 'NextColor' then
  573. -- next color
  574. if game:GetService('MarketplaceService'):PlayerOwnsAsset(plr,Ids['C']) then
  575. NextColor()
  576. else
  577. game:GetService('MarketplaceService'):PromptPurchase(plr,Ids['C'])
  578. end
  579. elseif action == 'MLGMode' then
  580. -- MLG mode
  581. if game:GetService('MarketplaceService'):PlayerOwnsAsset(plr,Ids['M']) then
  582. if IsMLGMode then
  583. MLGMode(plr,false)
  584. IsMLGMode = false
  585. else
  586. MLGMode(plr,true)
  587. IsMLGMode = true
  588. end
  589. else
  590. game:GetService('MarketplaceService'):PromptPurchase(plr,Ids['M'])
  591. end
  592. elseif action == 'Radio' then
  593. if game:GetService('MarketplaceService'):PlayerOwnsAsset(plr,Ids['R']) then
  594. local RadioSong = Steeringwheel.RadioSong
  595. RadioSong.SoundId = 'rbxassetid://'..ID
  596. RadioSong:Play()
  597. else
  598. game:GetService('MarketplaceService'):PromptPurchase(plr,Ids['R'])
  599. end
  600. elseif action == 'PauseRadio' then
  601. local RadioSong = Steeringwheel.RadioSong
  602. RadioSong:Pause()
  603. elseif action == 'UnpauseRadio' then
  604. local RadioSong = Steeringwheel.RadioSong
  605. RadioSong:Resume()
  606. elseif action == 'UnrepeatRadio' then
  607. local RadioSong = Steeringwheel.RadioSong
  608. RadioSong.Looped = false
  609. elseif action == 'RepeatRadio' then
  610. local RadioSong = Steeringwheel.RadioSong
  611. RadioSong.Looped = true
  612. end
  613. end)
  614.  
  615. if not game.ServerScriptService:findFirstChild('CWPurchasePrompter') then
  616. script.CWPurchasePrompter.Parent = game.ServerScriptService
  617. else
  618. script.CWPurchasePrompter:Destroy()
  619. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement