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

Can someone help me with detecting gamepad enabled?

Asked by 8 years ago

I have this script:

if game:GetService("UserInputService").GamepadEnabled then
    print("gamepad enabled")
    local instructions = player:WaitForChild("PlayerGui").Instructions.text
    print("found instructions")
    instructions.Visible = true
    wait(30)
    instructions.Visible = false
end

Everything before the script works perfectly fine. I have the exact same if game:GetService("UserInputService").GamepadEnabled then in another script in my game thats works fine. It is in a server script in the ServerScriptService. The script itself has to do with gamepass's.

Thank you in advance for any help.

1 answer

Log in to vote
0
Answered by 8 years ago

It should be in a local script and be placed in StarterGui, StarterPack or CharacterScripts. There is no need for it to be in a server script but if you want you can use a remoteevent to communicate to the server script.

0
The issue was that the script has to do with gamepass', which autocorrected to gamepads, so that's my bad. Gamepasses can only be handled in server scripts. FierceByte 25 — 8y
0
Well you can use a remoteevent from the local script and just handle it in the server script. LifeInDevelopment 364 — 8y
Ad

Answer this question