I'm trying to make a script that will make it so that when a player right-clicks any part with an "examine" intValue in it, a box pops up that has text in it. I've been trying to do this but with no luck. Here's what I have so far but I may be doing the completely incorrect thing to make this happen. Am I going in the right direction? Also this script is inside an importer script that puts this script into PlayerScripts when a player enters the game.
local sGui=script.ScreenGui
local frame=sGui.Frame
local player=game.Players.LocalPlayer
local mouse=player:GetMouse()
local function onRightClick()
local targ=mouse.Target
frame.Visible=true
end

2 comments
Of course this is possible.
Yes. You are going in the right direction. If you want to stick with using the Mouse object, you may want to listen to the Button2Down event: http://wiki.roblox.com/index.php?title=API:Class/Mouse/Button2Down. And, of course, you'll need to do :FindFirstChild("IntValue") on the target.