Hey, This is my second attempt on a script i am attempting. I am trying to make a script that allows the player to unanchor a part if a key is pressed and touching a certain block, I have used a normal script and a module script, however the functions don't seem to connect with eachother:
Module Script:
local onKeyPress = {} function onKeyPress(inputObject, gameProcessedEvent) end return onKeyPress
Script:
local OnKeyPress = require(game.Workspace.ModuleScript) function onTouch(hit) if **onKeyPress**().KeyCode == Enum.KeyCode.F and hit.game.workspace.Name == "DoorKick" then script.Parent.Parent.DoorKick.Anchored = false script.Parent.Parent.DoorKick.CanCollide = false end end script.Parent.Touched:connect(onTouch) game:GetService("UserInputService").InputBegan:connect(**onKeyPress**)
I put bold underneath the error and it says: W001: Unknown Global 'OnKeyPress'