Hi, I am trying to make the impossible hallway, and if the player steps on a part the color of the hallway change to make it look infinity. Anyways here's my script

local part = script.Parent
local player = game.Players.LocalPlayer

game.Workspace.Part.Touched:Connect(function(hit)
	local hum = hit.Parent:FindFirstChild("Humanoid")
	if (hum~=nil) then
		local changer = math.random(1,2)
		if changer = 1
			then game.Workspace.colorchange.BrickColor = BrickColor.new(3,3,3)
		
		
	end
end)


i am new to lua coding so i dont know how to make it like if the math.random number is 1 then the hallway becomes yellow somethin like that

2 comments

0

i realized brickcolor was supposed to be color name not code

0

You need to do script.Parent, You need to realize how many "Part"'s Is in the Workspace