I'm trying to make a Crate system.... I wanted to put pictures on it when the name pops up. How do i add a script to load the picture of the item when the name of it pops up???
local list = { "Rocket (Rare)", -- Rare 1 "Orange (Common)", "Orange (Common)", "Orange (Common)",-- Common 1 "Apple (Common)", "Apple (Common)", "Apple (Common)", -- Common 2 "Waterbottle (Common)", "Waterbottle (Common)", "Waterbottle (Common)", -- Common 3 "Soccerball (Uncommon)", "Soccerball (Uncommon)", -- Uncommon 1 "Football (Uncommon)", "Football (Uncommon)" -- Uncommon 2 } local Enabled = true script.Parent.MouseButton1Click:Connect(function() if Enabled == false then return end Enabled = false local time = 0.025 for i = 1, 75 do script.Parent.Parent.result.Text = list[math.random(1, #list)] if i == 50 then time = 0.05 end if i == 55 then time = 0.1 end if i == 60 then time = 0.2 end if i == 65 then time = 0.4 end if i == 70 then time = 0.8 end if i == 75 then script.Parent.Parent.text.Text = "You have aquired..." script.Parent.Parent.done.start.Disabled = false end wait(time) end end)
U can add or re Script the script... :) thanks
You would have to make the pictures itself and hide those pictures in the game storage. then simply assign every picture to the values. then insert the pic you want to a frame that is located near the text. for example:
local picList ={ RocketPic = --insert pic ids for all OrangePic = ApplePic = WaterbottlePic = SoccerballPic = FootballPic = } local list = { "Rocket (Rare)", -- Rare 1 "Orange (Common)", "Orange (Common)", "Orange (Common)",-- Common 1 "Apple (Common)", "Apple (Common)", "Apple (Common)", -- Common 2 "Waterbottle (Common)", "Waterbottle (Common)", "Waterbottle (Common)", -- Common 3 "Soccerball (Uncommon)", "Soccerball (Uncommon)", -- Uncommon 1 "Football (Uncommon)", "Football (Uncommon)" -- Uncommon 2 } local Enabled = true script.Parent.MouseButton1Click:Connect(function() if Enabled == false then return end Enabled = false local time = 0.025 for i = 1, 75 do script.Parent.Parent.result.Text = list[math.random(1, #list)] script.Parent.Parent.resultPic.Image = --base it off whatever the "list" value is if i == 50 then time = 0.05 end if i == 55 then time = 0.1 end if i == 60 then time = 0.2 end if i == 65 then time = 0.4 end if i == 70 then time = 0.8 end if i == 75 then script.Parent.Parent.text.Text = "You have aquired..." script.Parent.Parent.done.start.Disabled = false end wait(time) end end)