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:
local P = script.Parent
local player = P.Parent.Parent
local index = 1
local vehicles = {
-- {NAME , THUMBNAIL ID}
{"Toyota Corolla 2010" , 0}, --LEAVE ALL THUMBNAIL ID AS 0. THERE IS NO POINT FOR A PICTURE.
{"Smart Fortwo" , 0},
{"Sudiko Green Yoga" , 0},
{"Sudiko Blue Yoga" , 0},
{"Toyota Prius 2010" , 0},
{"BMW i3" , 0},
{"TCI" , 0},
{"Toyota Prius 2016" , 0}
}
wait(0.5)
-- GUI vars
local bg = P.BG
-- Helper function
function SetInformation(index)
bg.I.Image = "http://www.roblox.com/thumbs/asset.ashx?assetId="..vehicles[index][2].."&x=420&y=420"
bg.T.Text = vehicles[index][1]
end
local locked = false
bg.S.MouseButton1Click:connect(function()
local Money = player.leaderstats:FindFirstChild("Money")
if Money.Value > 9999 then
Money.Value = Money.Value - 10000
if (locked) then return end
locked = true
local vehicleName = player.Name.."Car"
local model = workspace:FindFirstChild(vehicleName)
if (model) then model:Destroy() end
model = game.ServerStorage.Vehicles:FindFirstChild(vehicles[index][1]):Clone()
model.Name = vehicleName
model.Parent = game.Workspace
model:MakeJoints()
model:MoveTo(P.Regen.Value.Position)
P:Destroy()
locked = false
else
script.Parent.BG.S.Text = "Not Enough Money, 10,000 Needed!"
wait(3)
script.Parent.BG.S.Text = "Select"
end
end)
bg.B.MouseButton1Click:connect(function()
index = index - 1
if (index < 1) then index = #vehicles end
SetInformation(index)
end)
bg.N.MouseButton1Click:connect(function()
index = index + 1
if (index > #vehicles) then index = 1 end
SetInformation(index)
end)
bg.Q.MouseButton1Click:connect(function()
P:Destroy()
end)
SetInformation(index)
This is a script in the serverstorage and the "vehicles" folder is in the server storage too
thanks for helping!!

2 comments
Also, you've got to change the position where the car goes ~ CrimsonFlux
My game is already in filtering enabled. Because of filtering enabled the script does not work. I need to make the script filtering enabled compatible.