Pressure plate script not working

Your model should look like this. Inside of the character is all of the character parts.
Screenshot_45

Along with that, the script should look like this:

local portal = script.Parent.Portal.Portal
local plate = script.Parent:WaitForChild(“Pressure Plate”)
local walls = script.Parent.Walls
local doc = script.Parent:WaitForChild(“Dr. James Calimari”)

local function OnTouch(Hit)
if Hit.Parent:FindFirstChild(“Humanoid”) then
walls.Wall1.CanCollide = false
walls.Wall2.CanCollide = false
walls.Wall3.CanCollide = false
portal.Transparency = 1

	for i,v in pairs(doc:GetChildren()) do
		if v:IsA("BasePart") then
			v.Transparency = 1
		end
	end
end

end

plate.Touched:Connect(OnTouch)

Hope this works! :slight_smile:

Oh ok. Btw would it still work if instead of script.parent.___ would it work as workspace. .

Indeed, you’d just have to go through the model and find all of the parts. I just find it easier to use script.Parent.

I noticed the then thing i totall6 missed that

Oh ok thx :+1: :+1: :+1: :+1: :+1::+1:

I 2ill try this tomarrow ill let u know if it works

ok i doesn’t work still so im sending and image of the script and workspace

I don’t know how you haven’t noticed that typo, as its visible in red line. You need to replace the quotes in WaitForChild, and also in other ones.

i noticed that but i didnt know why

and it didnt work -_

this is dr James

You need to give some more information on it, like any errors in the console, or what is the behavior currently.

You also need to read devforum rules, and not make empty posts with so less information.

Here is a link to the Official rules, which I recommend you to read before making any further posts. Official Rules of the Roblox Developer Forum

i don’t have the console open because i don’t know how to

Go to View Tab > Output, then when you play your game, it is where all the warns, errors and prints get logged at.

:+1: :+1: :+1: i will try that and see if there are errors

ok no errors popped up but it didnt work

ok i solved it i just changed the story a bit

When you say it isn’t working, what do you mean?
The way the script is set up, when the player touches the pressure plate, the portal goes transparent and the walls turn CanCollide false.
There isn’t anything here that changes those things back to visible and CanCollide true though.
Is the Portal just working once? Is it not working at all?
You have to learn how to describe what is or isn’t happening since we can’t see what’s going on or read your mind.
Imagine you are trying to explain it to a 5 year old. Explain it simply, but not assuming that we know anything about what you are explaining.

Okay so basically what happens is that in the script when the player touches it the walls can colitis off and the portal disappear but what happens is that when I walk on the pressure plate nothing happens nothing changes it just stays the same as before