Roblox Scripting Tutorial: RPGs Part 5 - Examine Tool
Today I'll be teaching you how to make an interact tool for RPGs and such. hope you enjoy!
Script:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local function onClicked(iName, iState, iObject)
local targ = mouse.Target
local story = player.PlayerGui.MainGUI.Story -- Change this line to whereever your GUI is.
if targ then
if targ:findFirstChild("Examine") ~= nil then
story.Visible = true
story.Text = targ:findFirstChild("Examine").Value
wait(5) -- Change this depending on how long you want the message to be on screen.
story.Visible = false
end
end
end
game.ContextActionService:BindAction("Interact", onClicked, false, Enum.UserInputType.MouseButton1,
Enum.UserInputType.Touch, Enum.KeyCode.ButtonY)
Be sure to follow me on Twitter after rating, commenting, and subscribing!
https://twitter.com/Rrrrry123
Also, follow me on Twitch for some live streams!
http://www.twitch.tv/Rrrrry123
You can add me on Roblox here!
http://ow.ly/7MWs305jb3B
Want to help make this channel better? You can donate to me via Roblox Robux!
http://ow.ly/En9x30hdeWy
Other Videos By RyGuyGaming
Other Statistics
Roblox Statistics For RyGuyGaming
At present, RyGuyGaming has 459,946 views spread across 106 videos for Roblox, and roughly a days worth of Roblox videos were uploaded to his channel. This makes up 17.76% of the content that RyGuyGaming has uploaded to YouTube.