My old question was answered but it still wouldn't work. The script the person who answered my question gave me had some errors so I changed it but now I "Attempted to call a nil value." Can anyone point out what my error was please? Please check the script below. Thank you for your time.

Script:

	local userInputService = game:GetService("UserInputService")
	local Inventory = script.Parent:GetChildren("Inventory")
 
	userInputService.InputBegan:Connect(function(input)
	 	if input.KeyCode == Enum.KeyCode.E then
			Inventory.Visible = true
			Inventory:TweenPosition{
			UDim2.new(0.068, 0, 0.077, 0), 
			Enum.EasingDirection.Out,
			Enum.EasingStyle.Quad,
			0.5,
			false
		}
	end
end)

3 comments

0

does inventory exist with how you find it?? if not, thats what the script is telling you.... also the script looks like you cut out some things, i suggest you give the full script so we can make the best of analysis

0

Try replacing line 2 with local Inventory = script.Parent:WaitForChild("Inventory")

0

The Inventory exists inside the ScreenGui