--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.FEInfo = function()
	carSeat.Parent.Body.Dash.S.G.Enabled = true
	wait(.1)
	carSeat.Parent.Body.Dash.S.G.FE.Visible = true
end

F.delete = function(plr)
	workspace[plr]:FindFirstChildOfClass("Humanoid").Jump = true
	wait(1)
	carSeat.Parent:Destroy()
end

F.shift = function(up)
	if up == true then
		carSeat.Parent.Misc.GL.SS.Motor.DesiredAngle = -.2
		wait(.3)
		carSeat.Parent.Misc.GL.SS.Motor.DesiredAngle = 0
	else
		carSeat.Parent.Misc.GL.SS.Motor.DesiredAngle = .2
		wait(.3)
		carSeat.Parent.Misc.GL.SS.Motor.DesiredAngle = 0
	end
end

F.reverse = function(yes)
	carSeat.Parent.Body.Lights.Reverse.Material = yes and "Neon" or "SmoothPlastic"
end

F.PM = function(m,p)
	carSeat.Mode.Value = m
	carSeat.PMult.Value = p
end

F.Dyn = function(h)
	carSeat.Parent.Wheels.FL.Spring.FreeLength = h
	carSeat.Parent.Wheels.FR.Spring.FreeLength = h
	carSeat.Parent.Wheels.RL.Spring.FreeLength = h
	carSeat.Parent.Wheels.RR.Spring.FreeLength = h
end

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