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

Guys can't set the value of frame visibility to true?

script.Parent.Touched:connect(function(p)
	if p.Parent.Name == "MainKey" then
		local door = script.Parent.Parent.Door1
		local handle = script.Parent
		local door2 = script.Parent.Parent.Door2
		local handle2 = script.Parent.Parent.Handle2
		door.Transparency = 1
		door.CanCollide = false
		handle.Transparency = 1
		door2.Transparency = 0
		door2.CanCollide = true
		handle2.Transparency = 0
		wait(1)
		door.Transparency = 0
		door.CanCollide = true
		handle.Transparency = 0
		door2.Transparency = 1
		door2.CanCollide = false
		handle2.Transparency = 1
		else
			game.StarterGui.DoorGUI.Instructions.Visible = true
	end
end)

I've tried this

script.Parent.Touched:connect(function(p)
	if p.Parent.Name == "MainKey" then
		local door = script.Parent.Parent.Door1
		local handle = script.Parent
		local door2 = script.Parent.Parent.Door2
		local handle2 = script.Parent.Parent.Handle2
		door.Transparency = 1
		door.CanCollide = false
		handle.Transparency = 1
		door2.Transparency = 0
		door2.CanCollide = true
		handle2.Transparency = 0
		wait(1)
		door.Transparency = 0
		door.CanCollide = true
		handle.Transparency = 0
		door2.Transparency = 1
		door2.CanCollide = false
		handle2.Transparency = 1
		elseif p.Parent.Name ~= "MainKey" then
			game.StarterGui.DoorGUI.Instructions.Visible = true
	end
end)

I've also tried this

local Instructionsss = game.StarterGui.DoorGUI.Instructions
script.Parent.Touched:connect(function(p)
	if p.Parent.Name == "MainKey" then
		local door = script.Parent.Parent.Door1
		local handle = script.Parent
		local door2 = script.Parent.Parent.Door2
		local handle2 = script.Parent.Parent.Handle2
		door.Transparency = 1
		door.CanCollide = false
		handle.Transparency = 1
		door2.Transparency = 0
		door2.CanCollide = true
		handle2.Transparency = 0
		wait(1)
		door.Transparency = 0
		door.CanCollide = true
		handle.Transparency = 0
		door2.Transparency = 1
		door2.CanCollide = false
		handle2.Transparency = 1
		else
			instructionsss.Visible = true
	end
end)

I've also tried adding a repeat and until!

2 comments

0

Put your code inside a code block.

1 answer

Guys any one that can answer this??

By the way the script is inside the part in workspace

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