Jump to content

I want to help


iiv03

Recommended Posts

Posted

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

  • Confused 2
Posted
2 minutes ago, svon1 said:

Can you normally say what you need? Because i really don't undestand you.o.O

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

153416116971251.png

Posted

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.

Posted

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 ?

Posted
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.

  • Confused 1
Posted
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?

Posted
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?

Posted
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.

Posted
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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...