Well for that you will need some list ,some gui and some item
For example if we have our item in a folder.
--So let create first by creating our folder in a place for example Lighting section,then we need a list of prize
PrizesFolder = -- Enter your directory of your prizes folder
Prizes = PrizesFolder:GetChildren()
PrizesN = {""} -- Our prizes list with their Name
PrizesI = {""} -- Enter by yourself all the Image ID of your thing
function SetPrizesList()
for p=1,#Prizes
table.insert(PrizesN,p,Prizes[p].Name) -- insert the value inside the list
end
end
SetPrizesList()
-- then we need to make our gui and button (Our script is in a local script,because we have a gui)
PrizeGui = Instance.new("ScreenGui",game.Players.LocalPlayer.PlayerGui)
PrizeGui.Name = "PrizeGui"
BGColors = {} -- Enter in here the three color value of your RGB (note it will be divided by the 255, so enter the 255 RGB color)
C = 255 -- our 255 constant (Dont change it for the RGB of your background)
BackGround = Instance.new("Frame",PrizeGui)
BackGround.Name = "PrizeBG"
BackGround.Visible = true
BackGround.Position = UDim2.new(0,300,0,400)
BackGround.Size = UDim2.new(0,200,0,200)
BackGround.BackgroundColor3 = Color3.new(BGColors[1]/C,BGColors[2]/C,BGColors[3]/C)
PrizeImage = Instance.new("ImageLabel",BackGround)
PrizeImage.Name = "PrizeImage"
PrizeImage.Position = UDim2.new(0,50,0,50)
PrizeImage.Size = UDim2.new(0,50,0,50)
PrizeName = Instance.new("TextLabel",BackGround)
PrizeName.Name = "PrizeName"
PrizeName.Position = UDim2.new(0,100,0,100)
PrizeName.Size = UDim2.new(0,100,0,30)
PrizeName.BackgroundTransparency = 1
WheelSpeed = 0.1 -- Change it for your own wheel speed
function RevealPrize() -- The last spin shows the image
for P=1,PrizeNo do
PrizeImage.Image = "rbxassetid://" .. PrizeI[I]
wait(WheelSpeed)
end
end
function Spin() -- The Effect of switching between prize
for S=1,WheelSpin do
for I=1,#PrizeI do
PrizeImage.Image = "rbxassetid://" .. PrizeI[I]
wait(WheelSpeed)
end
end
RevealPrize()
end
function LuckyWheel() -- Setting our wheel
SpinsSetup = {minSpin,maxSpin} -- Switch the minSpin and maxSpin with the number
WheelSpin = math.random (SpinsSetup[1],SpinsSetup[2]) -- will set a no of spin random
PrizeNo = math.random(1,#PrizeN)
PrizeName = PrizeN[PrizeNo]
Spin()
end
LuckyWheel()
|