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

Why is my userinput not doing anything when i click the button "E"? [Ansvered]

Asked by 4 years ago
Edited 4 years ago

code:

wait(3)
local hitbox = workspace:WaitForChild("UnderGround_Area").HitBox_Enter_Sewer
local input = game:GetService("UserInputService")
local plrname = game.Players.LocalPlayer.Name
local plr = game.Players:WaitForChild(plrname)
local UI = plr.PlayerGui:WaitForChild("Sewer")
local run = false
--
input.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.E then
        print("Pressed E")
    wait(1)
    end
    end)
0
Thank you! It really helped. Freddan2006YT 88 — 4y
0
Make sure this is in a LocalScript, and make sure it is a descendant of a Player. I noticed that the double hyphen caused line 9 to appear to be a comment in the browser, but that doesn't happen in Studio. Unhumanly 152 — 4y

Answer this question