F.updateWindows=function(g,R)if script.Parent.Parent.Windows:findFirstChild(g)then(script.Parent.Parent.Windows:findFirstChild(g)).Value=R end end F.volumedown=function(g)carSeat.Parent.Body.MP.Sound.Volume=carSeat.Parent.Body.MP.Sound.Volume-1 end F.volumeup=function(g)carSeat.Parent.Body.MP.Sound.Volume=carSeat.Parent.Body.MP.Sound.Volume+1 end F.fm=function(g)carSeat.Parent.Body.MP.Sound:Stop()carSeat.Stations.mood.Value=g end F.updateSong=function(g)carSeat.Stations.mood.Value=5 carSeat.Parent.Body.MP.Sound:Stop()wait()carSeat.Parent.Body.MP.Sound.SoundId="\114\098\120\097\115\115\101\116\105\100\058\047\047"..g wait()carSeat.Parent.Body.MP.Sound:Play()end F.pauseSong=function()carSeat.Stations.mood.Value=5 carSeat.Parent.Body.MP.Sound:Stop()end F.updateVolume=function(g)carSeat.Parent.Body.MP.Sound.Volume=carSeat.Parent.Body.MP.Sound.Volume+g/5 end F.updateValue=function(g,R)if g then g.Value=R end end F.Sport=function()carSeat.Mode.Value="\083\112\111\114\116"carSeat.Parent.Wheels.FL.Spring.FreeLength=2.2 carSeat.Parent.Wheels.FR.Spring.FreeLength=2.2 carSeat.Parent.Wheels.RL.Spring.FreeLength=2.2 carSeat.Parent.Wheels.RR.Spring.FreeLength=2.2 carSeat.EcoIdle.Value=2 end F.Comfort=function()carSeat.Mode.Value="\067\111\109\102\111\114\116"carSeat.Parent.Wheels.FL.Spring.FreeLength=2.8 carSeat.Parent.Wheels.FR.Spring.FreeLength=2.8 carSeat.Parent.Wheels.RL.Spring.FreeLength=2.8 carSeat.Parent.Wheels.RR.Spring.FreeLength=2.8 carSeat.EcoIdle.Value=1 end F.Dynamic=function()carSeat.Mode.Value="\068\121\110\097\109\105\099"carSeat.Parent.Wheels.FL.Spring.FreeLength=1.8 carSeat.Parent.Wheels.FR.Spring.FreeLength=1.8 carSeat.Parent.Wheels.RL.Spring.FreeLength=1.8 carSeat.Parent.Wheels.RR.Spring.FreeLength=1.8 carSeat.EcoIdle.Value=3 end script.Parent.OnServerEvent:connect(function(g,R,...)if F[R]then F[R](...)end end)
--F.updateSound = function(Sound, Pitch, Volume)
--	if Sound then
--		if Pitch then
--			Sound.Pitch = Pitch
--		end
--		if Volume then
--			Sound.Volume = Volume
--		end
--	end
--end

F.updateWindows = function(Window, Toggle)
	if script.Parent.Parent.Windows:findFirstChild(Window) then
		script.Parent.Parent.Windows:findFirstChild(Window).Value = Toggle
	end
end

F.volumedown = function(VolDown)
	carSeat.Parent.Body.MP.Sound.Volume = carSeat.Parent.Body.MP.Sound.Volume - 1
end

F.volumeup = function(VolUp)
	carSeat.Parent.Body.MP.Sound.Volume = carSeat.Parent.Body.MP.Sound.Volume + 1
end

F.fm = function(ok)
	carSeat.Parent.Body.MP.Sound:Stop()
	carSeat.Stations.mood.Value = ok
end

F.updateSong = function(id)
	carSeat.Stations.mood.Value = 5
	carSeat.Parent.Body.MP.Sound:Stop()
	wait()
	carSeat.Parent.Body.MP.Sound.SoundId = "rbxassetid://" .. id
	wait()
	carSeat.Parent.Body.MP.Sound:Play()
end

F.pauseSong = function()
	carSeat.Stations.mood.Value = 5
	carSeat.Parent.Body.MP.Sound:Stop()
end

F.updateVolume = function(Vol)
	carSeat.Parent.Body.MP.Sound.Volume = carSeat.Parent.Body.MP.Sound.Volume + Vol / 5
end

F.updateValue = function(Val, Value)
	if Val then
		Val.Value = Value
	end
end

F.Sport = function()
	carSeat.Mode.Value = "Sport"
	carSeat.Parent.Wheels.FL.Spring.FreeLength = 2.2
	carSeat.Parent.Wheels.FR.Spring.FreeLength = 2.2
	carSeat.Parent.Wheels.RL.Spring.FreeLength = 2.2
	carSeat.Parent.Wheels.RR.Spring.FreeLength = 2.2
	carSeat.EcoIdle.Value = 2
end

F.Comfort = function()
	carSeat.Mode.Value = "Comfort"
	carSeat.Parent.Wheels.FL.Spring.FreeLength = 2.8
	carSeat.Parent.Wheels.FR.Spring.FreeLength = 2.8
	carSeat.Parent.Wheels.RL.Spring.FreeLength = 2.8
	carSeat.Parent.Wheels.RR.Spring.FreeLength = 2.8
	carSeat.EcoIdle.Value = 1
end

F.Dynamic = function()
	carSeat.Mode.Value = "Dynamic"
	carSeat.Parent.Wheels.FL.Spring.FreeLength = 1.8
	carSeat.Parent.Wheels.FR.Spring.FreeLength = 1.8
	carSeat.Parent.Wheels.RL.Spring.FreeLength = 1.8
	carSeat.Parent.Wheels.RR.Spring.FreeLength = 1.8
	carSeat.EcoIdle.Value = 3
end

script.Parent.OnServerEvent:connect(function(Player, Func, ...)
	if F[Func] then
		F[Func](...)
	end
end)
