generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Club Houses » Let's Make a Deal
Home Search
 

Re: GIANT CAR SAVING SCRIPT!!!

Previous Thread :: Next Thread 
verbalAKspray is not online. verbalAKspray
Joined: 09 Jul 2014
Total Posts: 23685
29 Jul 2015 08:41 PM
local Cars = game.ServerStorage['Cars']
local Custom = game.ReplicatedStorage['Customization']

local function Replace(Part, Replacement, Info, Type)
local partInfo = Info[Type][Part.Name]
Replacement = Replacement['Replacement'][partInfo['Type']]:Clone()
local Primary = partInfo['PrimaryPart']
Replacement.PrimaryPart = Replacement[Primary]
Part.PrimaryPart = Part[Primary]
Replacement:SetPrimaryPartCFrame(Part:GetPrimaryPartCFrame())
Replacement.Parent = Part.Parent
Replacement.Name = Part.Name
Part:Destroy()
local tbb = Replacement:GetChildren()
for i = 1,#tbb do
if tbb[i].Name == 'Paint' then
local p = tbb[i]
p.BrickColor = partInfo['BrickColor']
p.Reflectance = partInfo['Reflectance']
end
end
end

local function ReplacePart(Part, Replacement, Info, Type)
local partInfo = Info[Type][Part.Name]
Replacement = Replacement['Replacement'][partInfo['Type']]:Clone()
Replacement.CFrame = Part.CFrame
Replacement.Parent = Part.Parent
Replacement.Name = Part.Name
Part:Destroy()
end

local function ReplaceDecal(Decal, Replacement, Info, Type)
local decalInfo = Info[Type][Decal.Name]
Decal.Texture = decalInfo
end

local function loadCar(Info)
local Car = Cars[Info['Type']]
local Customs = Custom[Info['Type']]

local tb = {
Car['VehicleSeat']['Server']['Performance'],
Car['VehicleSeat']['Server']['Stats'],
}
for i = 1,#tb do
local c = tb[i]:GetChildren()
for ii = 1,#c do
c[ii].Value = Info[tb[i].Name][c[ii].Name]
end
end

local Body = Car:findFirstChild('Body')
if Body then
local bodyParts = Customs['Aesthetics']['Exterior']['Body']
tb = Body:GetChildren()
for i = 1,#tb do
local Part = tb[i]
local Replacement = bodyParts:findFirstChild(Part.Name)
if Replacement then
Replace(Part, Replacement, Info, 'Body')
elseif Part.Name == 'Paint' then
Part.BrickColor = Info['Body']['BrickColor']
Part.Reflectance = Info['Body']['Reflectance']
end
end
end

Replace(Car['Exhaust'], Customs['Aesthetics']['Exhaust'], Info, 'Car')
local Wheels = Car['Wheels']:GetChildren()
local customW = Customs['Aesthetics']['Exterior']['Wheels']
for i = 1,#Wheels do
local w = Wheels[i]
ReplacePart(w['Tire'], customW['Tires'], Info, 'Wheels')
Replace(w['Rim'], customW['Rims'], Info, 'Wheels')
ReplaceDecal(w['Tire']['Blank'], customW['Tires']['Tire Brand'], Info, 'Wheels')
end

tb = {Car['frontBrakes'], Car['rearBrakes']}
local brakeInfo = Info['Brakes']
for i = 1,#tb do
local Brakes = {tb[i]['R']['Calipers'], tb[i]['L']['Calpiers']}
for ii = 1,#Brakes do
Brakes[ii].BrickColor = brakeInfo['BrickColor']
Brakes[ii].Reflectance = brakeInfo['Reflectance']
end
end
return Car
end

local function saveCar(Car)
local Info = {}
local Customs = Custom[Info['Type']]
local tb = {
Car['VehicleSeat']['Server']['Performance'],
Car['VehicleSeat']['Server']['Stats'],
}
for i = 1,#tb do
local c = tb[i]:GetChildren()
for ii = 1,#c do
Info[tb[i].Name] = c[ii].Value
end
end

local Body = Car:findFirstChild('Body')
if Body then
local bodyParts = Customs['Aesthetics']['Exterior']['Body']
tb = Body:GetChildren()
for i = 1,#tb do
local Part = tb[i]
local Replacement = bodyParts:findFirstChild(Part.Name)
if Replacement then
Info['Body'][Part.Name]['Type'] = Part['Type'].Value
local Paint = Part:findFirstChild('Paint')
if Paint then
Info['Body'][Part.Name]['BrickColor'] = Paint.BrickColor
Info['Body'][Part.Name]['Reflectance'] = Paint.Reflectance
end
end
end
local Paint = Body['Paint']
Info['Body']['BrickColor'] = Paint.BrickColor
Info['Body']['Reflectance'] = Paint.Reflectance
end

Info['Car']['Exhaust']['Type'] = Car['Exhaust']['Type'].Value
local Wheels = Car['Wheels']:GetChildren()
for i = 1,#Wheels do
local w = Wheels[i]
Info['Wheels']['Tire']['Type'] = w['Tire']['Type'].Value
Info['Wheels']['Rim']['Type'] = w['Rim']['Type'].Value
Info['Wheels']['Blank'] = w['Tire']['Blank'].Texture
end

local Brakes = Car['frontBrakes']['R']['Calipers']
Info['Brakes']['BrickColor'] = Brakes.BrickColor
Info['Reflectance']['Reflectance'] = Brakes.Reflectance
return Info
end
Report Abuse
verbalAKspray is not online. verbalAKspray
Joined: 09 Jul 2014
Total Posts: 23685
29 Jul 2015 08:42 PM
ITS BIG
ITS BAD

ITS

MIGHTY
Report Abuse
harrddy is not online. harrddy
Joined: 01 May 2009
Total Posts: 29753
29 Jul 2015 08:43 PM
just like my weiner
Report Abuse
verbalAKspray is not online. verbalAKspray
Joined: 09 Jul 2014
Total Posts: 23685
29 Jul 2015 08:46 PM
i agree
Report Abuse
harrddy is not online. harrddy
Joined: 01 May 2009
Total Posts: 29753
29 Jul 2015 08:50 PM
look in game
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » Let's Make a Deal
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image