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

Won't detect if a player is on xbox?

Asked by 3 years ago

why won't this work?

local UserInputService = game:GetService("UserInputService")
local lastInput = UserInputService:GetLastInputType()

if UserInputService.GamepadEnabled and not UserInputService.KeyboardEnabled then 
    script.Parent.Enabled = true
end

and

local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.Gamepad1 then
        if input.KeyCode == Enum.KeyCode.ButtonA then
            script.Parent.Parent:Destroy()
        end
    end
end)

its suppose to check if the player is on xbox and if they are show the gui, and once they press a it destroys it

please help.

0
Are you testing this on a computer using an xbox controller? If so, its probably detecting that both keyboard and gamepad are enabled. SteamG00B 1633 — 3y
0
Also if you could show your hierarchy, that would be helpful. SteamG00B 1633 — 3y
0
no im not testing it with any controller since i dont have one, MrBloxyPixel 4 — 3y

Answer this question