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 * Vector3.one
local region = Region3.new(rootPart.Position - extents, rootPart.Position + extents)
local np = workspace:FindPartsInRegion3WithIgnoreList(region,{character,camera})
print(np)
for _, p in np do
if p:GetAttribute("canGet") and not p:FindFirstChildOfClass("ProximityPrompt") then
local b = Instance.new("ProximityPrompt")
local n = p:GetAttribute("name")
b.ActionText = "Get"
b.ObjectText = n
b.Parent = p
b.Triggered:Connect(function()
p:Destroy()
end)
b.PromptHidden:Connect(function() -- ERROR --
b:Destroy()
end)
end
end
end
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