Issues with a card activated door

Oh yeah, there’s no space between Room and 000

1 Like

So… I’ve removed the space. Changed all the scripts effecting the space to remove it… AND STILL DOESN’T WORK?..

If it would make you feel any better, I’ll give you this part that I made to test your code. It works perfectly fine for me, but it makes use of players touching the door instead of cards. Just use the code for a reference.

Door.rbxm (2.8 KB)

1 Like

Heres a file to the buggy door if you need it:

CardDoorIssue.rbxl (24.5 KB)

Also - How in the actual world do I open .rbxm files? It just opens notepad?

You have to drag them into an open studio place

1 Like

I think I found the problem :slight_smile: quite embarassed for not seeing this

local db = false
script.Parent.DoorMain.Touched:Connect(function(handle)
	print(handle.Parent.Name)
	if db == false then
		db = true
		if handle.Parent.Name == 'Room'.. script.Parent.Configuration.RoomNumber.Value 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("Wrong card")
		end
	db = false
	end
end)

Your card name is “Room201” but the code says “Card201”

2 Likes

Nope, xD.

1 Like

Hmmmm it worked for me :confused:
CardDoorIssueFixed.rbxl (24.5 KB)

3 Likes

Hm, let me check it out. :slight_smile:

1 Like

Alright, whenever I put the card in StarterPack, and I’m not inserting it… It just… works? But whenever I use the script… It wont?

1 Like

It’s because you’re parenting the card to ReplicatedStorage and not a player’s backpack?

2 Likes

Yes, but whenever I do however, set the cards parent to the backpack of the player, it doesnt work…?

1 Like

What’s your script to give players a card?

2 Likes
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('Players'):WaitForChild('wayIxn').Backpack

local db = false
script.Parent.DoorMain.Touched:Connect(function(handle)
	print(handle.Parent.Name)
	if db == false then
		db = true
		if handle.Parent.Name == 'Room'.. script.Parent.Configuration.RoomNumber.Value 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("Wrong card")
		end
	db = false
	end
end)

Line 2, it doesnt even parent.

Whenever I give it via command bar, it doesnt work…?

game.ReplicatedStorage.WC_Rooms['Room201'].Parent = game.Players.wayIxn.Backpack
1 Like

Whevener I do any ‘Alternative’ other than setting its default parent to StarterPack (which would never work for the game I’m working on) it simply doesnt open. Though when I change absolutely NOTHING it does.

1 Like

Nvm - Had to parent it on the server side. Thank you SO MUCH for your 1h+ of time to help me. You’re truly amazing and I can’t thank you enough. :))) :heart:

2 Likes