Hi! Im currently trying to make a door that functions when the player presses ‘E’, everything works except for the GUI popping up when the player gets near.
The GUI seems to only want to pop up for only one door. There are three door types, although this information doesn’t matter, Up, Left, and Right.
Here is the block of code in question:
RunService.Heartbeat:Connect(function(delta)
local rootpart = Player.Character:WaitForChild("HumanoidRootPart")
local humanoid = Player.Character:WaitForChild("Humanoid")
for _, radius in ipairs(workspace:GetDescendants()) do
if radius.name == "DoorRadius" then
if (rootpart.Position - radius.Parent.Position).Magnitude <= radius.Value then
guiMenu.Enabled = true
else
guiMenu.Enabled = false
end
end
end
end)