Trying to trigger this function. Will someone tell me how to call this function correctly?
Asked by
4 years ago Edited 4 years ago
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.
01 | local KeyCardBlock = game.workspace.KeyCardBlock |
02 | local KeyCard = game.workspace.KeyCard |
03 | local SoundFolder = game.workspace.SoundFolder |
05 | KeyCardBlock.thing.Touched:Connect( function () |
06 | if Tool.Parent = = game.StarterPack then |
07 | local keycardcall = 'key card used' |
12 | if KeyCard.Parent = = game.workspace |
13 | local deny = 'Key card denied.' |
15 | SoundFolder.TemporarySound.Playing = true |
17 | SoundFolder.TemporarySound.Playing = false |
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.