You need to use a Touched event on the pressure plate or the ball. See if the touched object is the ball / pressure plate. If it is than play a tween using tween service to open the door.
Nope, can you try format the text completely since I need things directly laid out to understand
local trigger = game.Workspace.plate
local function onPartTouched(otherPart)
local ball = game.Workspace.ball
local plate = game.Workspace.plate
local door = game.Workspace.Doorpuzzle
if platet.Parent:FindFirstChild("ball") then
if hit.Parent:FindFirstChild(game.Workspace.ball) then
door.Transparency = true
door.CanCollide = false
end
end
trigger.Touched:Connect(onPartTouched)
Can you try correct that code but have the complete code there?
Yea there is a lot of things wrong with this. I created my own simulation in a new template with a script you can use. Here it is:
local trigger = game.Workspace.Part
local function ontouched(hit)
local door = game.Workspace.Door
if hit.Parent:FindFirstChild("Ball") then
door.Transparency = 0.5
door.CanCollide = false
end
end
trigger.Touched:Connect(ontouched)
I hope you can understand this and use it in your game. If you have any other issues, please let me know.
That would actually be best. You should just make the trigger the script’s parent. Some things might also not be what you intended so you might need to change up some names. Well I hope this helps.