Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is this examine script theoretically possible?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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.

1local sGui=script.ScreenGui
2local frame=sGui.Frame
3local player=game.Players.LocalPlayer
4local mouse=player:GetMouse()
5 
6local function onRightClick()
7    local targ=mouse.Target
8    frame.Visible=true
9end
0
Of course this is possible. BlueTaslem 18071 — 9y
0
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. XAXA 1569 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

So Should I use (part) as an argument for onButton2Down() to tell it that I want the function to happen when a part is right clicked? This is what I have so far

01local sGui=script.ScreenGui
02local frame=sGui.Frame
03local player=game.Players.LocalPlayer
04local mouse=player:GetMouse()
05 
06local function onButton2Down(part)
07    local targ=mouse.Target
08if part:FindFirstChild("examine")~= nil
09    then
10 
11    frame.Visible=true
12end
13end
0
The answer section is not for the Questioner to use, it is where you question will obviously be answered, Do not post here with another question on answers, either edit your question or comment bellow it. alphawolvess 1784 — 9y
0
sorry, its just that usually when I comment I don't get a response back, and I can't fit code into a comment, but I'll try editing my original post Gwolflover 80 — 9y
Ad

Answer this question