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

(string expected, got EnumItem) Value Error, Can someone help me?

Asked by 6 years ago
Edited by OldPalHappy 6 years ago
local UserInputService = game:GetService("UserInputService")
local function onInputBegan(input,gameProcessed)
    if input.UserInputType == Enum.UserInputType.Keyboard then
    local keyPressed = input.KeyCode
    script.Parent.Value.Value = input.KeyCode
    print("a")
    print(input.KeyCode)
    end
end

UserInputService.InputBegan:connect(onInputBegan)

and the output is

01:21:01.744 - Players.Kwok6140.PlayerGui.Console.Script:5: bad argument #3 to 'Value' (string expected, got EnumItem)

0
You could try tostring(input.KeyCode), but idk if that'll work. OldPalHappy 1477 — 6y
0
Ok Kwok6140 -2 — 6y
0
Not working but Thank Kwok6140 -2 — 6y
0
You can't place a KeyCode value in a string value BlizzardBan 15 — 6y

Answer this question