How do I make this script filtering enabled?? Steps plz?
Hi, im a new scripter and I would appreciate you helping me make this script filtering enabled step by step, so i can disect it and learn. I have a car spawning GUI which lets you choose which car you want to spawn and select it. If you have over 10,000 money then it spawns the car clicked on to a location.
The Gui is working fine, and when I click the buy button it works (says error if i dont have 10,000), however the car doesnt spawn to the location from the workspace
Car spawning script:
01 | local P = script.Parent |
02 | local player = P.Parent.Parent |
07 | { "Toyota Corolla 2010" , 0 } , |
09 | { "Sudiko Green Yoga" , 0 } , |
10 | { "Sudiko Blue Yoga" , 0 } , |
11 | { "Toyota Prius 2010" , 0 } , |
14 | { "Toyota Prius 2016" , 0 } |
22 | function SetInformation(index) |
24 | bg.T.Text = vehicles [ index ] [ 1 ] |
28 | bg.S.MouseButton 1 Click:connect( function () |
29 | local Money = player.leaderstats:FindFirstChild( "Money" ) |
30 | if Money.Value > 9999 then |
31 | Money.Value = Money.Value - 10000 |
33 | if (locked) then return end |
35 | local vehicleName = player.Name.. "Car" |
36 | local model = workspace:FindFirstChild(vehicleName) |
37 | if (model) then model:Destroy() end |
38 | model = game.ServerStorage.Vehicles:FindFirstChild(vehicles [ index ] [ 1 ] ):Clone() |
39 | model.Name = vehicleName |
40 | model.Parent = game.Workspace |
42 | model:MoveTo(P.Regen.Value.Position) |
47 | script.Parent.BG.S.Text = "Not Enough Money, 10,000 Needed!" |
49 | script.Parent.BG.S.Text = "Select" |
53 | bg.B.MouseButton 1 Click:connect( function () |
55 | if (index < 1 ) then index = #vehicles end |
59 | bg.N.MouseButton 1 Click:connect( function () |
61 | if (index > #vehicles) then index = 1 end |
65 | bg.Q.MouseButton 1 Click:connect( function () |
This is a script in the serverstorage and the "vehicles" folder is in the server storage too
thanks for helping!!