Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

1 comment

0

Line 45 is supposed to have neon and not "Material"

1 answer

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.

1 comment

0

yeah so you need a remote event to use scripts in FE

This discussion is preserved as it was. New answers, comments, and votes are closed.