HumanoidRootPartWait = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart") Coal = workspace.Coal Stick = workspace.Sticks HumanoidRootPart = game.Players.LocalPlayer.Character.HumanoidRootPart LocalPlayer = game.Players.LocalPlayer while wait(1) do if (HumanoidRootPart.Position - Stick.Position).Magnitude < 10 or (HumanoidRootPart.Position - Coal.Position).Magnitude < 10 then LocalPlayer.PlayerGui.ScreenGui.Enabled = true else LocalPlayer.PlayerGui.ScreenGui.Enabled = false end end LocalPlayer.PlayerGui.ScreenGui.TextButton.Activated:connect(function() end)
Is there a way to know which object the player is close to? Sticks or coal in this place, without having multiple if statements to check what it is close to.?
You could have a 'hitbox' and detect if that's touched, and use a remoteevent to enable it using 'FireClient'. I do not know any other way.