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

Why is it when the specified key is pressed, nothing appears in the output?

Asked by 5 years ago

Hello everyone, hope you all are having a lovely day! So, i was creating a script (its located in the StarterPlayer.StarterPlayerScripts ) and when i press "L" - nothing happens - im completly baffeled ;-; can someone please show me how to fix it ?

thanks - goku

local player = game.Players.LocalPlayer -- something else
local ipit = game:GetService("UserInputService")


ipit.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.E then
        print("22")
    end
end)

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Well, I dont know which script you used.. but if it was a ServerScript. This wouldn`t work. Why? Because LocalPlayer can only work in a LocalScript, not ServerScript. You also placed it in thw wrong place. You should have placed it inside StarterPack. I dont know if you noticed but you said you pressed L, you made the key E, not L.

And one more thing:

print("Hello!") --When you write a text, you HAVE to include them " "

print(22) --When you write a number, you dont need to include them " ", but both ways work.

print("There are 22 cows") --Even if you have a number with a text, you still need them " ", since you got a text.

Hope I helped. :)

0
Thanks and i really feel dumb now :P ScriptingNubs 55 — 5y
0
Sometimes I do to when I make really small mistakes like messing up the names. lol :P HeyItzDanniee 252 — 5y
Ad

Answer this question