Currently I’m having issues with a door not activating.
Basically I want the script to detect if the card ‘Room 000’ (000 being the room number obviously) has been held up to the door. I feel as my script is correct but isn’t activating as I feel it should.
Heres the script:
local RoomTool = game:GetService('ReplicatedStorage'):WaitForChild('WC_Assets'):WaitForChild('Room'):Clone() RoomTool.Name = 'Room '..script.Parent:WaitForChild('Configuration'):WaitForChild('RoomNumber').Value RoomTool.Parent = game:GetService('ReplicatedStorage'):WaitForChild('WC_Rooms') local db = false script.Parent.DoorMain.Touched:Connect(function(plr) if db == false then db = true if plr.Parent:FindFirstChild('Room '..script.Parent:WaitForChild('Configuration'):WaitForChild('RoomNumber').Value) ~= nil then script.Parent.DoorMain.Transparency = 1 script.Parent.DoorMain.CanCollide = false wait(1) script.Parent.DoorMain.Transparency = 0 script.Parent.DoorMain.CanCollide = true else print(plr.Parent.Name) end db = false end end)
else print(plr.Parent.Name) end
-part of the script is saying my characters appearance items.