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

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

Asked by 2 years ago

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

Log in to vote
0
Answered by
lamgogo 56
2 years ago
Edited 2 years ago

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

Ad

Answer this question