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

Trying to trigger this function. Will someone tell me how to call this function correctly?

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

0

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

1 answer

I tried make it so it would check if you have the key card. It obviously didn't work.

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