Part Transparency isn't changing with a LocalScript

I’m trying to change the appearance of a group of parts for the player only, however the transparency of the outline and part isn’t changing. Only the colors and collision do.

robloxapp-20220412-1733409.wmv (856.9 KB)
sorry for low quality

I’ve looked around and haven’t seen anyone with the same issue as me.

local UserInputService = game:GetService("UserInputService")
local PhysicsService = game:GetService("PhysicsService")

local delayT = 0.5 -- Delay time for the jump debounce.
local isJump = false -- Create jumping variable.
local state = true -- True is white, false is black.
local player = script.Parent.Parent.Name -- Get player information.

local light = workspace.light:GetChildren()
local dark = workspace.dark:GetChildren()

local lSky = "http://www.roblox.com/asset/?id=9299998779"
local dSky = "http://www.roblox.com/asset/?id=9299998579"


function setSky(assetID)
	local sky = game.Lighting.Sky
	
	sky.SkyboxBk = assetID
	sky.SkyboxDn = assetID
	sky.SkyboxFt = assetID
	sky.SkyboxLf = assetID
	sky.SkyboxRt = assetID
	sky.SkyboxUp = assetID

end

function onJumpRequest()
	if not isJump then
		isJump = true
		print("Jump!")
		if not state then
			state = true
			
			setSky(lSky)
			
			for i, child in ipairs(light) do
				local outline = child.outline
				child.Color = Color3.fromHex("000000")
				child.Transparency = 0
				child.CanCollide = true
				outline.Transparency = 1
			end
			
			for i, child in ipairs(dark) do
				local outline = child.outline
				child.Transparency = 1
				child.CanCollide = false
				outline.Color3 = Color3.fromHex("000000")
				outline.Transparency = 0
				
			end
			
			print("white")
		else 
			state = false
			
			setSky(dSky)
			
			for i, child in ipairs(light) do
				local outline = child.outline
				child.Color = Color3.fromHex("FFFFFF")
				child.Transparency = 0
				child.CanCollide = false
				outline.Transparency = 1
			end

			for i, child in ipairs(dark) do
				local outline = child.outline
				child.Transparency = 1
				child.CanCollide = true
				outline.Color3 = Color3.fromHex("FFFFFF")
				outline.Transparency = 0
			end
			
			print("black")
		end
		wait(delayT)
		isJump = false
	end
end

UserInputService.JumpRequest:Connect(onJumpRequest)

If anyone has any insight please let me know!

1 Like

The transparency values were backwards, causing the values to not change at all when I jumped.

1 Like