Hello, I am currently needed help with making this Car Spawner script to just spawn for free as you can see I have attempted to make it free but you still have to buy it for $10k not $0. I have tried a lot and I would like it if someone could give me some insight to how to make it free or remove the money needed part intirely.
local P = script.Parent local player = P.Parent.Parent local index = 1 local vehicles = { -- {NAME , THUMBNAIL ID} {"Black Taurus RCMP" , 0}, --LEAVE ALL THUMBNAIL ID AS 0. THERE IS NO POINT FOR A PICTURE. {"Crown Vic RCMP" , 0}, {"Undercover RCMP" , 0}, {"Undercover RCMP" , 0}, {"Unmarked Ford Tarus RCMP" , 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 > 0 then Money.Value = Money.Value - 1 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, $1.00 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)
The only thing relating to paying money in this script is located on line 27 where it checks if you have money then removes 1 from your cash. I don't see anything that takes away that cash so Im guessing your problem lies in another script, but here is this script without anything money related to it
local P = script.Parent local player = P.Parent.Parent local index = 1 local vehicles = { -- {NAME , THUMBNAIL ID} {"Black Taurus RCMP" , 0}, --LEAVE ALL THUMBNAIL ID AS 0. THERE IS NO POINT FOR A PICTURE. {"Crown Vic RCMP" , 0}, {"Undercover RCMP" , 0}, {"Undercover RCMP" , 0}, {"Unmarked Ford Tarus RCMP" , 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() if true then 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, $1.00 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)
Here is the next script that creates the money, is there someway to make the two scripts make it so that the Car's are free and don't request this money script to spawn the cars.
function Entered(player) wait() if player:findFirstChild("leaderstats") ~= nil then end local stats = Instance.new("IntValue") stats.Parent = player stats.Name = "leaderstats" local money = Instance.new("IntValue") money.Parent = stats money.Name = "Money"--Moneys name, Like 'Turkish Lira' or 'Money' or 'Dollers' or 'Iraqi Dinar' money.Value = 50000 --How much you start out with change it to how much you want end game.Players.PlayerAdded:connect(Entered) c = game.Players:GetChildren() for i=1, #c do Entered(c[i]) end --454 Studios, User454