Answered by
6 years ago Edited 6 years ago
Revised Local Script
01 | local ContextActionService = game:GetService( "ContextActionService" ) |
02 | local function EnterDoor(actionName, inputState, inputObj) |
03 | if inputState = = Enum.UserInputState.Begin then |
04 | local DoorDistance = (workspace.Door 1. Zone.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude |
05 | if DoorDistance < = 50 then |
06 | print ( "you went in the door yay" ) |
11 | ContextActionService:BindAction( "GoInDoor" , EnterDoor, true , Enum.KeyCode.E) |
EDITS
A. You need to alter "e" to the actual Enum KeyCode
B. The function for the ContextActionService contains three parameters, the first of which is the action's name, which you had tried to define as the inputstate.