I'm making a keycard so when it touches the keycardblock it calls a function (no errors in the output). It would be nice if someone could suggest a efficient way to trigger this function, I did the best I could but nothing happens.
local KeyCardBlock = game.workspace.KeyCardBlock
local KeyCard = game.workspace.KeyCard
local SoundFolder = game.workspace.SoundFolder
KeyCardBlock.thing.Touched:Connect(function()
if Tool.Parent == game.StarterPack then
local keycardcall = 'key card used'
print (keycardcall)
---write function for whatever block is changed by this
end
if KeyCard.Parent == game.workspace
local deny = 'Key card denied.'
print (deny)
SoundFolder.TemporarySound.Playing = true
wait (3)
SoundFolder.TemporarySound.Playing = false --Sound must be updated
end
end)
I'm trying to make the computer check whether the keycard is in the StarterPack. It doesn't work when I walk right up to the key card machine and then the transparent 'thing' which should call the function.

1 comment
Not exactly sure what you're trying to do. For better assistance and faster responses I recommend going into the scripting helpers discord server!