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

Someone Can help me with my for Open Door with ProximityPrompt ?

I try to make a system for Open a door with tool with ProximityPrompt , but the script not working, i try to fix him but i found no solution to fix him.

local Door = script.Parent.Parent.Parent.Parent.Parent.Door.Door
local player = game.Players.LocalPlayer
local tool = player.Backpack:FindFirstChild("KeyPadCracker")
local Prompt = script.Parent
local DrillingSound = script.Parent.Parent.Parent.DrillSound



if tool then
	script.Parent.Triggered:Connect(function()
		Door.Transparency = 1
		Door.CanCollide = false
	end)
end

1 answer

if your using a normal script localplayer wont work so what you should do is remove the player and tool variable

also remove the if statement. then for the prompt part it should look like this instead

--because the paramaters for the proximityprompt is the player who activated it
Prompt.Triggered:Connect(function(player) 

	--it waits for the keypadcracker in the players backpack so it has to be unequipped to use it
	--if its there then the door transparency and cancollide properties will change
	if player.Backpack:WaitForChild("KeyPadCracker") then
		Door.Transparency = 1
		Door.Cancollide = false
	end
end)

So i hope this helped you but make sure you keep the other variables

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