hi. so i’m trying to modify this open sourced handto utility system made by @7kayoh but its made so that you have to script in some way for it to be toggled. i’m not a very experienced scripter, and this is quite advanced code for me. if someone could help me understand what to add and how i should add it, that would be amazing. heres the code for the toggle thingy
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Common = ReplicatedStorage:WaitForChild("Common")
local Modules = {}
local _UI
local Bindable = Instance.new("BindableFunction")
local function Invoke(Type)
if _UI then
if Type == "Toggle" then
_UI.Properties.Toggled = not _UI.Properties.Toggled
_UI:Deploy()
end
end
end
local function Init()
local Container = Instance.new("ScreenGui")
_UI = Modules.Cook.new(Container)
Container.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
Bindable.Parent = script
Container.Parent = Players.LocalPlayer.PlayerGui
Bindable.OnInvoke = Invoke
_UI:Deploy()
end
for _, v in pairs(Common:GetChildren()) do
if v:IsA("ModuleScript") then
Modules[v.Name] = require(v)
end
end
Init()
Hi! I really appreciate your help, thank you. The only script I see relating to this is Hander > UI > App but no client.lua. If the script your looking for is the UI app script where the toggle is, I added it to the original post.
I think something like this might work. It’s untested, but I feel like it should be correct
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Common = ReplicatedStorage:WaitForChild("Common")
local Modules = {}
local _UI
local Bindable = Instance.new("BindableFunction")
local UIS = game:GetService("UserInputService")
local function Invoke(Type)
if _UI then
if Type == "Toggle" then
_UI.Properties.Toggled = not _UI.Properties.Toggled
_UI:Deploy()
end
end
end
local function Init()
local Container = Instance.new("ScreenGui")
_UI = Modules.Cook.new(Container)
Container.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
Bindable.Parent = script
Container.Parent = Players.LocalPlayer.PlayerGui
Bindable.OnInvoke = Invoke
_UI:Deploy()
end
for _, v in pairs(Common:GetChildren()) do
if v:IsA("ModuleScript") then
Modules[v.Name] = require(v)
end
end
UIS.InputBegan:Connect(function(input: InputObject, gameProcessedEvent: boolean)
if not gameProcessedEvent and input.KeyCode == Enum.KeyCode.P then -- Change Enum.KeyCode.P to whichever keycode you want
Invoke("Toggle")
end
end)
Init()
alright i tried that. i really appreciate you writing the code for me you didn’t have to . it didnt work for some reason, i checked output and no errors. in the script you had, i didnt see anything with the deploy function which i assume would deploy the UI, maybe thats the issue? once again i appreciate your help a ton