Hello developers,
I have some problem with make interacting GUI. There is an error that says
attempt to index nil with 'Position
I tried to search in Roblox wiki but I hardly understand it
thi is my script:
local door = game.Workspace.Bar.Door
local player = game.Players.LocalPlayer
local char = player.Character
local RHP = char:FindFirstChild("HumanoidRootPart")
local bill = script.Parent.BillboardGui
local but = bill.TextButton
local door = game.Workspace.Bar.Door
local UseInputService = game:GetService("UserInputService")
UseInputService.InputBegan:Connect(function(input, gameproces)
if not gameproces then
if input.KeyCode == Enum.KeyCode.E then
print("yoo")
if (RHP.Position - door.Position).Magnitude < 15 then
game.ReplicatedStorage.RemoteEvent.OpenDoor:FireServer()
print("yoo")
end
end
end
end)
any reply is appreciated!!