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 8 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.

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

0
Of course this is possible. BlueTaslem 18071 — 8y
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 — 8y

1 answer

Log in to vote
0
Answered by 8 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

local sGui=script.ScreenGui
local frame=sGui.Frame
local player=game.Players.LocalPlayer
local mouse=player:GetMouse()

local function onButton2Down(part)
    local targ=mouse.Target
if part:FindFirstChild("examine")~= nil 
    then 

    frame.Visible=true
end
end
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 — 8y
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 — 8y
Ad

Answer this question