Roblox Studio Crashes when trying to use ProximityPrompt events

I didn’t know where to put this topic in which category, but rather it’s a roblox studios error or so I think, what happens is that when trying to call 2 ProximityPromopt Roblox Studios events it crashes without any message

Here I leave the Script that Causes this error

local Player = game:GetService("Players")
local Run = game:GetService("RunService")

local camera = workspace.CurrentCamera
local plr = Player.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local rootPart = character:WaitForChild("HumanoidRootPart")

while task.wait(0.25) do
	local extents = 6 *
	local region = - extents, rootPart.Position + extents)
	local np = workspace:FindPartsInRegion3WithIgnoreList(region,{character,camera})
	for _, p in np do
		if p:GetAttribute("canGet") and not p:FindFirstChildOfClass("ProximityPrompt")  then
			local b ="ProximityPrompt")
			local n = p:GetAttribute("name")
			b.ActionText = "Get"
			b.ObjectText = n
			b.Parent = p
			b.PromptHidden:Connect(function() --          ERROR            --

What this script does is detect every 0.25s the objects that the player has in a diameter of 5 studs, but when adding the PromptHidden event and Trigger the same event the Game closes without any error message

My purpose with this theme is to help improve the environment of Roblox Studios

The truth is that you should use a script class that is in the part or in the proximipront since I don’t think it is viable to use a while true do since it would be too much for the server. Remember that the server is only one

I forgot to mention that this happens on the Client side, The Script is a LocalScript

Sorry, I hadn’t seen the local player, I really don’t know anything about that and I can’t give you a solution, but take a good look at the output and put several prints in each zone to see how far it runs and the category is script support