[BUG] Using key(tool) to open door and Dropping a tool TELEPORTS YOU (hard to explain)

I have no idea whats going on here, I have a Gui the pops up when you step on/in a block. I have a key that unanchors that block which makes it fall through the map so you dont see the msg the gui shows. It works everywhere EXCEPT where i want it. I want it inside a room which has a teleporter to it and out but whenever i try it, its works BUT it teleports you out to the outside teleporter. I know… its hard to explain. I had someone try to figure it out but he didnt know.

How to preform the glitch:
pick up key
go inside the cage with hole in it and step on teleport
DONT HOLD THE KEY
go inside the gui block (u know ur in it if the gui pops up)
hold the key

Heres a link to the game: [Alpha] Ruins - Roblox


This is the gui block

This is the code for the gui block

local GUI = script.Parent.PopUpGUI
script.Parent.Touched:Connect(function(hit)
if hit.Parent and game.Players:FindFirstChild(hit.Parent.Name) then
local plr = game.Players[hit.Parent.Name]
if plr:FindFirstChild(“PlayerGui”) and not plr.PlayerGui:FindFirstChild(GUI.Name) then
GUI:Clone().Parent = plr.PlayerGui
end
end
end)

AND

script.Parent.Touched:connect(function(p ) ← i left a space bc dev forums turns it into → (p)
if p.Parent.Name == “Key1” then
script.Parent.Transparency = 1
script.Parent.CanCollide = false
script.Parent.Anchored = false
end
end)


This is the key (its a mesh, but i tried it with a block and same glitch happened).
image

NOTE: WHAT I DISCOVERED (i think)
ITS MOST LIKELY A GLITCH WITH THE KEY, WHENEVER I DROP IT, IT TELEPORTS YOU TO THE SAME SPOT.

please help i have no idea how to fix it. its so weird it only works if u press hold on the key when your inside the block already, and also sometimes when you drop the key it also teleports you.

Can you make it so the key can’t be dropped?

1 Like

For some reason, it stopped happening, ill get back to you in a min

Hi mods i know i posted this in the wrong section. whoops

Yeah idk its not happening anymore