Error:

Config is not a valid member of Part

The script itself:

local UserInputService = game:GetService("UserInputService")
local PlayerService = game:GetService('Players')
local Player = PlayerService.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local PressE = game.Workspace.ModelDoor.Door.PressE.BillboardGui
Center = game.Workspace.ModelDoor.Door.Center
Config = game.Workspace.ModelDoor.Door.Config
local DB = 1
Mouse = game.Players.LocalPlayer:GetMouse()
local Open = false
Medium = game.Workspace.Medium
local Activ = false
local Obj = nil
UserInputService.InputBegan:Connect(function(Input)
	if Activ and Input.UserInputType == Enum.UserInputType.Keyboard and Input.KeyCode == Enum.KeyCode.E then
		Obj.Config.DetectEvent:FireServer() ---------------------Error here
	end
end)
while wait() do
	Obj = nil
	Activ = false
	for _, ModelDoor in pairs(workspace.ModelDoor.Door:GetChildren()) do
		local mag = (Character.HumanoidRootPart.Position - Center.Position).magnitude
		if mag <= Config.Range.Value then
			Activ = true
			Obj = ModelDoor
			PressE.Enabled = true
			
		end
		end
end

6 comments

0

Expain what you are doing with this code

0

In the sense of?

0

in the sence of what you want this code to do and background information which would help us understand how to help you

0

there's simply no obj in that part that is named config.

0

just some tips to make things look cleaner: when you're defining variables as nil or false just write 'local VariableName', and it will set the value to nil/false. Use workspace to reference workspace as well.

0

Edit: Removed unnecessary characters from the title