--###----------[[SERVICES]]----------###-- local Players = game:GetService("Players") --###----------[[VARIABLES]]----------###-- local Player = Players.LocalPlayer local PlayerGui = Player:WaitForChild("PlayerGui") local RollButton = PlayerGui:WaitForChild("RollButton") local BuFoRol = RollButton:WaitForChild("BuFoRol") local ImageBMS = { 4967482266, 4967478161, 5723075768, 5723077460, 5723079075, 5723081342; } local ImageLabel = script.Parent --###----------[[FUNCTIONS]]----------###-- local function SetRandomImage() local RandomImageID = ImageBMS[Random.new(tick()):NextInteger(1, #ImageBMS)] --------------- ImageLabel.Image = "rbxassetid://"..RandomImageID end --###----------[[SETUP]]----------###-- BuFoRol.MouseButton1Click:Connect(SetRandomImage)
This is the script inside two different imagelabels, after changing them 15 time sin a row, they both showed the same image from all of the times i changed them, i wnat to make them show random images, that differentiate from the other one. How would I do that?
to see what happening go here: [https://www.youtube.com/watch?v=pNBtULkpefc&feature=youtu.be]
--###----------[[SERVICES]]----------###-- local Players = game:GetService("Players") --###----------[[VARIABLES]]----------###-- local Player = Players.LocalPlayer local PlayerGui = Player:WaitForChild("PlayerGui") local RollButton = PlayerGui:WaitForChild("RollButton") local BuFoRol = RollButton:WaitForChild("BuFoRol") local ImageBMS = { 4967482266, 4967478161, 5723075768, 5723077460, 5723079075, 5723081342; } local ImageLabel = script.Parent --###----------[[FUNCTIONS]]----------###-- local function SetRandomImage() --------------- ImageLabel.Image = "rbxassetid://"..ImageBMS[math.random(1, #ImageBMS)] --Selects a random index from the table end --###----------[[SETUP]]----------###-- BuFoRol.MouseButton1Click:Connect(SetRandomImage)