Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make BillboardGUI change images with press of a key?

I have a Billboard GUI, and I want to make it so when the key E is pressed the billboardgui's imageabel will change, I came up with a script and it doesn't work, can anyone help?

my script:

script.parent.mouse.KeyDown:connect(function(key) if key == "e" then script.Parent.Image = imageAsset1 wait(.15) script.Parent.Image = imageAsset2 wait(.25) script.Parent.Image = imageAsset3 wait(.35) script.Parent.Image = imageAsset1 end)

1 answer

✓ Accepted answer

Maybe at the if key == "e",change it to: if key == Enum.Keycode.E

If the script doesnt work,use this to trigger instead:

game:GetService("UserInputService").InputBegan:Connect(function(input,gpe) if not gpe then if input.KeyCode == Enum.KeyCode.E then --do the image change thing here end end end)

i write this on web so there might be some usual problems

This discussion is preserved as it was. New answers, comments, and votes are closed.