of     1   

darkhenry
#228350781Saturday, December 02, 2017 10:55 PM GMT

Hi, hope you're doing well on this fine day. (FilteringEnabled) here's my script, just a simple test. local plr = game.Players.LocalPlayer local main_gui = plr:WaitForChild("PlayerGui"):WaitForChild("test") local frame = main_gui:WaitForChild("Frame") frame.BackgroundTransparency = 1 Mouse = plr:GetMouse() Mouse.KeyDown:Connect(function(Key) Key = Key:lower() if Key == "g" then frame.BackgroundTransparency = 0 end end) I was wondering how I would use the same button "g" to then turn the frame's BackgroundTransparency to 1 again. I've searched the Object browser on Mouse and I didn't find anything on keys..
little5
#228350837Saturday, December 02, 2017 10:56 PM GMT

You could do frame.BackgroundTransparency = not frame.BackgroundTransparency if frame.BackgroundTransparency == 1
darkhenry
#228351206Saturday, December 02, 2017 11:05 PM GMT

It doesn't just pertain to transparency though. I was just wondering if you could press "g" twice and perform different functions. Thanks for your reply. :)
darkhenry
#228351364Saturday, December 02, 2017 11:08 PM GMT

bump
128Gigabytes
#228351486Saturday, December 02, 2017 11:11 PM GMT

I think what little was trying to say is you can change this line frame.BackgroundTransparency = 0 to this frame.BackgroundTransparency = ((frame.BackgroundTransparency == 1) and 0 or 1) to make it a toggle
Aliics
#228351638Saturday, December 02, 2017 11:14 PM GMT

ternary operators yo
128Gigabytes
#228351736Saturday, December 02, 2017 11:17 PM GMT

ternary operators are my bread and butter
128Gigabytes
#228351834Saturday, December 02, 2017 11:19 PM GMT

darkhenry
#228351843Saturday, December 02, 2017 11:19 PM GMT

Thanks to both of you :) helped me out alot
Aliics
#228351902Saturday, December 02, 2017 11:21 PM GMT

Well that's an interesting bit of code. I'd highly suggest commenting it.
JarodOfOrbiter
#228352436Saturday, December 02, 2017 11:32 PM GMT

This is the most interesting bit of code I've seen to date: https://forum.roblox.com/Forum/ShowPost.aspx?PostID=149568340
Luo_Basics
#228352632Saturday, December 02, 2017 11:37 PM GMT

here's my script, just a simple test. local plr = game.Players.LocalPlayer local main_gui = plr:WaitForChild("PlayerGui"):WaitForChild("test") local frame = main_gui:WaitForChild("Frame") frame.BackgroundTransparency = 1 local UIS = Game:GetService("UserInputService") UIS.InputBegan:Connect(function(key, gpe) if gpe then return end if key.KeyCode == Enum.KeyCode.G then frame.BackgroundTransparency = frame.BackgroundTransparency == 1 and 0 or 1 end end) sorry for tabbing did this in post editor thingy
Spiritation
#228352655Saturday, December 02, 2017 11:37 PM GMT

wouldn't use keydown local uis = game:GetService("UserInputService") uis.InputBegan:connect(function(input, gameProcessed) if input.KeyType == Enum.KeyType.G then frame.BackgroundTransparency = 0 end end)
Spiritation
#228352707Saturday, December 02, 2017 11:39 PM GMT

KeyCode* use the person's code above me pl0x
Luo_Basics
#228352745Saturday, December 02, 2017 11:40 PM GMT

is that baby carlos lol? nice
128Gigabytes
#228355298Sunday, December 03, 2017 12:37 AM GMT

funny that Im also in that post @Jarod

    of     1