script.Parent.Touched:connect(function(plr)
	local UIS = game:GetService("UserInputService")
	UIS.InputBegan:connect(function(input)
		if input.KeyCode == Enum.KeyCode.G then
			script.Parent.Parent.Parent:Destroy()
		end
	end)
end)

7 comments

0

Use a code block

0

there

0

UserInputServing only works in localscripts.

0

service*

0

You would have to use a remoteevent.

0

Ok thanks

0

It wont work