I am currently making a customization gui and I have an arrow button, I want to click it and get a face, then click it again to get a different face. How do I do this?? Also I have another arrow button on the left and i want it to go down the list of faces and save were it was left off. Sorry if this is hard to understand.

14 comments

0

Use an array.

0

its a customization tab you can press the left and right arrows to move from left to right.

0

Same answer.

0

Any places you can give me a solid tutorial using arrays and guis? Thanks.

0

local array = {face1,face2,face3,face4} -- function Left() -- x = x-1 -- if (x < 1) then -- x=4 -- end -- face=array[x] -- end -- function Right() -- x = x+1 -- if (x > 4) then -- x=1 -- end -- face=array[x] -- end -- --Here put event triggers based on which button was pressed.

0

Each " -- " represents a new line.

0

Sorry I do not understand how I will run code in each face i will just make a sloppy version.

0

rip project

0

No, make the array variable have a variable for each face. In order of when they were defined in the curly braces, they are indexed as such in this example: array = {"one","two","three"} print(array[1]) --one print(array[2]) --two

0

OHHH i got it but how would i run a line of code in this array?

0

What do you mean?

0

NVM FOUND OUT

0

local array = {"rbxassetid://58235423", "rbxassetid://175648590", "rbxassetid://155286585", "rbxassetid://69548408"} local currentPosition = 1 local plr = game.Players.LocalPlayer.CharacterAdded:wait() script.Parent.Right.MouseButton1Click:connect(function() currentPosition = currentPosition < #array and currentPosition + 1 or currentPosition plr.Head.face.Texture = (array[currentPosition]) end

0

Looks good to me