Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make changes to the server from a localscript with filteringEnabled?

Asked by 6 years ago

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.

function Car()
--Variables
    local Player = game.Players.LocalPlayer
    local Character = Player.Character
    local Evrythn = script.Parent.Parent.Parent.Parent.Parent.EVERYTHING
    local camera = game.Workspace.Camera
    local CarPack = game.Lighting:FindFirstChild(Player.Name.. "s_CarPack")
    local Car = CarPack.Nissan
    local CarClone = Car:Clone()
    local primpart = CarClone.PrimaryPart
--Move the car
    CarClone.Parent = game.Workspace.CurrentCamera
    CarClone:makeJoints()
    CarClone:MoveTo(Vector3.new(1774.9, 7652.45, 28754.186))
    CarClone.Name = (Player.Name.. "s_CustomCar")
    camera.CameraSubject = primpart
    CarClone.Remover.Disabled = true
    Player.CameraMaxZoomDistance = 25
    primpart.Anchored = true
    Character.Humanoid.WalkSpeed = 0

--GUI Work
    Evrythn.CarSelector.ColorCustomizaton.Visible = true
    Evrythn.CarSelector.CustomizeCars.Visible, Evrythn.CarSelector.SpawnCars.Visible, Evrythn.Close.Visible = false
    Evrythn.CarSelector.ColorCustomizaton.Button_Handler.Disabled = false
    Evrythn.OpenMainMenu.Debounce.Value = false
    Evrythn.OpenCarsMenu.Debounce.Value = false
end
script.Parent.MouseButton1Click: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

function SavePlayerCar()    
    local CarToClone = game.Workspace.CurrentCamera:WaitForChild(plr.Name .. "s_CustomCar")
    local CarClone = CarToClone:Clone()
    local CarName = CarToClone.Car.CarName.Value
    local CarPack = game.Lighting:WaitForChild(plr.Name.."s_CarPack")
    --Save car to player's custom car pack
    CarPack:WaitForChild(CarName):remove()
    CarClone.Parent = CarPack
    CarClone.Name = CarName
end
script.Parent.Save.MouseButton1Click: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.

0
Trying using RemoteEvent MizeryGFX 15 — 6y
0
I did try that. I need to transfer a Model, not a command. doot_d0ot 5 — 6y
0
Basically what I'm asking is - "Can you transfer models from Client to Server with a localscript with filteringEnabled?" doot_d0ot 5 — 6y

Answer this question