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

Gui in a tool script?

Asked by 10 years ago

Hello, I've been trying to type a script that lets as gui popup when you open a tool.. I just can't think of what to put.. Anyone know a script?

1 answer

Log in to vote
2
Answered by 10 years ago

Inside the tool?

local Gui = Game:GetService("ReplicatedStorage").??? --The gui
local Player = Game:GetService("Players").LocalPlayer --Get the local player

local Tool = script.Parent

Tool.Equipped:connect(function() --Executes when the tool is equipped
if not Player.PlayerGui:FindFirstChild(Gui.Name) then --Makes sure he does not have the gui
Gui:Clone().Parent = Player.PlayerGui --Gives the gui
end
end)
0
It's like a gui inside of a tool, And when you open the tool the gui opens. OshkoshTrucks 0 — 10y
Ad

Answer this question