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

is there anyway to make a gui button to make a list? explained better in thread.

Asked by
VVired 28
7 years ago
Edited 7 years ago

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.

0
Use an array. KillPowerAlex135 5 — 7y
0
its a customization tab you can press the left and right arrows to move from left to right. VVired 28 — 7y
0
Same answer. KillPowerAlex135 5 — 7y
0
Any places you can give me a solid tutorial using arrays and guis? Thanks. VVired 28 — 7y
View all comments (10 more)
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. KillPowerAlex135 5 — 7y
0
Each " -- " represents a new line. KillPowerAlex135 5 — 7y
0
Sorry I do not understand how I will run code in each face i will just make a sloppy version. VVired 28 — 7y
0
rip project VVired 28 — 7y
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 KillPowerAlex135 5 — 7y
0
OHHH i got it but how would i run a line of code in this array? VVired 28 — 7y
0
What do you mean? KillPowerAlex135 5 — 7y
0
NVM FOUND OUT VVired 28 — 7y
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 VVired 28 — 7y
0
Looks good to me KillPowerAlex135 5 — 7y

Answer this question