My code is calling a function before the trigger does?
Asked by
4 years ago Edited 4 years ago
It's very confusing and only yesterday it was working fine.
1 | local functionblock 3 = game.workspace.FunctionBlock 3 |
2 | local AppearingBlock = game.workspace.AppearingBlock |
4 | functionblock 3. Touched:Connect( function () |
5 | local functionblock 3 = "functionblock3 in use" |
7 | AppearingBlock.Transparency = 0 |
8 | AppearingBlock.Cancollide = true |
The one I just copy and pasted is meant to call a function when the player touches a block, however when I test my game, the function is already called.
1 | local FunctionBlock 2 = game.workspace.FunctionBlock 2 |
2 | local DissapearingBlock = game.workspace.DissapearingBlock |
4 | FunctionBlock 2. Touched:Connect( function () |
5 | local functionblock = 'function block touched' |
7 | DissapearingBlock.Transparency = 1 |
8 | DissapearingBlock.Cancollide = false |
This code calls a function when my character touches a block, again, it worked fine just yesterday but the function calls before I even step on the block.