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

my material for my car taillights change doesnt work for some reason, can somebody help?

Asked by 3 years ago

this is the code i would like help TL is the model where i put the tailights for this car in TL1 is the one im currently trying to change (i will change rest later) Trail1 is when brakes are not currently being applied (or when your not pressing s) Trail2 is when brakes are being applied (or when you are pressing s)

-- lines 25 and 43 dont work but the rest of this does
-- keep in mind im trying to make an extension to this code so it wont make sence
-- i think its material change written incorrectly

local FE = workspace.FilteringEnabled
local car = script.Parent.Parent.Parent.Car.Value
local handler = car:WaitForChild("Lights_FE")
---

    script.Parent.Parent.Parent.Values.Brake.Changed:connect(function()
        if script.Parent.Parent.Parent.Values.Brake.Value ~= 1 and script.Parent.Parent.Parent.IsOn.Value then
            if FE then
                handler:FireServer("Trail1") --trails off
            else
            car.Body.Trails.a0.Enabled = false
            car.Body.Trails.a1.Enabled = false
            car.Body.Trails.a2.Enabled = false
            car.Body.Trails.a3.Enabled = false
            car.Body.Trails.a4.Enabled = false
            car.Body.Trails.a5.Enabled = false
            car.Body.Trails.a6.Enabled = false
            car.Body.Trails.a7.Enabled = false
            car.Body.Trails.a8.Enabled = false
            car.Body.Trails.a9.Enabled = false
            car.Body.Trails.a10.Enabled = false
            car.Body.Trails.a11.Enabled = false
            workspace.CodingsR34.Body.TL.TL1.Material = "Plastic"
            end
        else
            if FE then
                handler:FireServer("Trail2") --trails on
            else
            car.Body.Trails.a0.Enabled = true
            car.Body.Trails.a1.Enabled = true
            car.Body.Trails.a2.Enabled = true
            car.Body.Trails.a3.Enabled = true
            car.Body.Trails.a4.Enabled = true
            car.Body.Trails.a5.Enabled = true
            car.Body.Trails.a6.Enabled = true
            car.Body.Trails.a7.Enabled = true
            car.Body.Trails.a8.Enabled = true
            car.Body.Trails.a9.Enabled = true
            car.Body.Trails.a10.Enabled = true
            car.Body.Trails.a11.Enabled = true
            workspace.CodingsR34.Body.TL.TL1.Material= "Material"
            end
        end
    end)

0
Line 45 is supposed to have neon and not "Material" Lord_F1re 1 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Ive found the problem actually, by reading the script i found that the material change only happens when filtering disabled is on, FE breaks this so i think i can fix the scripts now, no answer needed.

0
yeah so you need a remote event to use scripts in FE Lord_F1re 1 — 3y
Ad

Answer this question