How do I make changes to the server from a localscript with filteringEnabled?
What I'm trying to do here is create a system where a player can customize the colors on their car. Now, without filteringEnabled, it's fairly straightforward. I had it completed.
03 | local Player = game.Players.LocalPlayer |
04 | local Character = Player.Character |
05 | local Evrythn = script.Parent.Parent.Parent.Parent.Parent.EVERYTHING |
06 | local camera = game.Workspace.Camera |
07 | local CarPack = game.Lighting:FindFirstChild(Player.Name.. "s_CarPack" ) |
08 | local Car = CarPack.Nissan |
09 | local CarClone = Car:Clone() |
10 | local primpart = CarClone.PrimaryPart |
12 | CarClone.Parent = game.Workspace.CurrentCamera |
14 | CarClone:MoveTo(Vector 3. new( 1774.9 , 7652.45 , 28754.186 )) |
15 | CarClone.Name = (Player.Name.. "s_CustomCar" ) |
16 | camera.CameraSubject = primpart |
17 | CarClone.Remover.Disabled = true |
18 | Player.CameraMaxZoomDistance = 25 |
19 | primpart.Anchored = true |
20 | Character.Humanoid.WalkSpeed = 0 |
23 | Evrythn.CarSelector.ColorCustomizaton.Visible = true |
24 | Evrythn.CarSelector.CustomizeCars.Visible, Evrythn.CarSelector.SpawnCars.Visible, Evrythn.Close.Visible = false |
25 | Evrythn.CarSelector.ColorCustomizaton.Button_Handler.Disabled = false |
26 | Evrythn.OpenMainMenu.Debounce.Value = false |
27 | Evrythn.OpenCarsMenu.Debounce.Value = false |
29 | script.Parent.MouseButton 1 Click:Connect(Car) |
It places a car in the player's CurrentCamera, and allows them to see it while they customize their car. Then when they click another button, it runs this
01 | function SavePlayerCar() |
02 | local CarToClone = game.Workspace.CurrentCamera:WaitForChild(plr.Name .. "s_CustomCar" ) |
03 | local CarClone = CarToClone:Clone() |
04 | local CarName = CarToClone.Car.CarName.Value |
05 | local CarPack = game.Lighting:WaitForChild(plr.Name.. "s_CarPack" ) |
07 | CarPack:WaitForChild(CarName):remove() |
08 | CarClone.Parent = CarPack |
09 | CarClone.Name = CarName |
11 | script.Parent.Save.MouseButton 1 Click:Connect(SavePlayerCar) |
Which acts as a save button. Now all of this works Fine WITHOUT filteringEnabled; I know why it doesn't work with filteringEnabled, it's running from a localscript.
My question to you is: How do I get it to copy the car from the CLIENT and put it in something on the SERVER.