iiv03 Posted August 13, 2018 Share Posted August 13, 2018 How to make the picture if the player pressed the button left or right moving picture left and right means Press Left button = Next image Press right button = before image I want to understand how I want a script 2 Link to comment
namebot Posted August 13, 2018 Share Posted August 13, 2018 Can you normally say what you need? Because i really don't undestand you. Link to comment
iiv03 Posted August 13, 2018 Author Share Posted August 13, 2018 2 minutes ago, svon1 said: Can you normally say what you need? Because i really don't undestand you. I just want you to want me to work the board and I have made it a button to open when the player and when the programming in the buttons I want the player to press the left button change the image to the left and if the player pressure right back Previous image Link to comment
WorthlessCynomys Posted August 13, 2018 Share Posted August 13, 2018 You have to store the images in a table and make a pointer that indicates which image is shown at the moment. On the click of the button, you change that pointer's value in the right direction, then redraw the image. Link to comment
iiv03 Posted August 13, 2018 Author Share Posted August 13, 2018 oh how ? can u give me link in wiki or script easy please ? 9 minutes ago, WorthlessCynomys said: You have to store the images in a table and make a pointer that indicates which image is shown at the moment. On the click of the button, you change that pointer's value in the right direction, then redraw the image. oh how ? can u give me link in wiki or script easy please ? Link to comment
WorthlessCynomys Posted August 13, 2018 Share Posted August 13, 2018 Just now, liwahadri said: oh how ? can u give me link in wiki or script easy please ? Images = { -- You store the images here. Like: "Image.png", "Image2.png", "Image3.png", -- and so on }; local currentImage = 1; local image = guiCreateStaticImage(x, y, width, height, Images[currentImage]); addEventHandler("onClientGUIClick", root, function() if (source == theButtonElement) then currentImage = currentImage+1; guiStaticImageLoadImage(image, Images[currentImage]); end end ); This is totally basic. It won't work in this exact form, but It should give you an idea on how to do it. 1 Link to comment
iiv03 Posted August 13, 2018 Author Share Posted August 13, 2018 2 hours ago, WorthlessCynomys said: Images = { -- You store the images here. Like: "Image.png", "Image2.png", "Image3.png", -- and so on }; local currentImage = 1; local image = guiCreateStaticImage(x, y, width, height, Images[currentImage]); addEventHandler("onClientGUIClick", root, function() if (source == theButtonElement) then currentImage = currentImage+1; guiStaticImageLoadImage(image, Images[currentImage]); end end ); This is totally basic. It won't work in this exact form, but It should give you an idea on how to do it. thanks here : x, y, width, height, Just Here I put coordinates in guiStaticImage? Which I have? Will it work? Link to comment
WorthlessCynomys Posted August 13, 2018 Share Posted August 13, 2018 22 minutes ago, liwahadri said: thanks here : x, y, width, height, Just Here I put coordinates in guiStaticImage? Which I have? Will it work? Yup Link to comment
iiv03 Posted August 13, 2018 Author Share Posted August 13, 2018 31 minutes ago, WorthlessCynomys said: Yup I have a question about the script that you gave me and I knew the location of the coordinates of the picture, but how do I know the location of the button to change its coordinates? Link to comment
WorthlessCynomys Posted August 13, 2018 Share Posted August 13, 2018 2 hours ago, liwahadri said: I have a question about the script that you gave me and I knew the location of the coordinates of the picture, but how do I know the location of the button to change its coordinates? I don't really understand what you are trying to say. Link to comment
Keiichi1 Posted August 13, 2018 Share Posted August 13, 2018 Why don't you implement the code Worthless gave you into your code, you already have? It's possible with some basic lua knowledge. Link to comment
iiv03 Posted August 14, 2018 Author Share Posted August 14, 2018 4 hours ago, Keiichi1 said: Why don't you implement the code Worthless gave you into your code, you already have? It's possible with some basic lua knowledge. I do not understand 8 hours ago, WorthlessCynomys said: I don't really understand what you are trying to say. I would tell you how if I took the position of the button right or left and how I set it in the script that you gave me to agree with the button with its image means if you press the button change its image how? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now