Gui = Instance.new("ScreenGui", game.CoreGui)
Button = Instance.new("TextButton", Gui)
Button.Size = UDim2.new(0, 100, 0, 40)
Button.BackgroundTransparency = 0.7
Button.Position = UDim2.new(0.003, 0, 0.93, 0)
Button.Text = "Enable Noclip"
Button.TextColor3 = Color3.new(255, 255, 255)
noclip = false
game:GetService('RunService').Stepped:connect(function()
if noclip then
game.Players.LocalPlayer.Character.Humanoid:ChangeState(11)
end
end)
Button.MouseButton1Down:connect(function()
noclip = not noclip
if Button.Text == "Enable Noclip" then
Button.Text = "Disable Noclip"
else
Button.Text = "Enable Noclip"
end
end)
how do i make the thing this gui activates when i press the button with my cursor activate with a key?
edit:
noclip = true
game:GetService('RunService').Stepped:connect(function()
if noclip then
game.Players.LocalPlayer.Character.Humanoid:ChangeState(11)
end
end)
now the noclip is true ,how do i make it false by pressing a key? and then if i press again it will be true again, and the response i got at the other question didnt work

1 comment
format your question: https://forum.scriptinghelpers.org/topic/82/how-to-format-questions-answers-on-the-main-site