Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Fixed by Venetrix!
- ]]
- local Raritytimes = {
- ["Common"] = 5,
- ["Uncommon"] = 3,
- ["Rare"] = 1,
- }
- local CrateInude = false
- local function opencrate(Chance)
- if CrateInude == false then
- CrateInude = true
- local items = {}
- local frametimes = math.random(30,32)
- local rewardbutton
- for i,v in pairs(game.ReplicatedStorage.ItemStorage:GetChildren()) do
- local rarnumber = Raritytimes[v.Rarity.Value] or 1
- local mathmatical = math.max(Raritytimes[v.Rarity.Value]+Chance)
- for i = 1,mathmatical do
- table.insert(items,v)
- end
- end
- math.randomseed(tick())
- for i = 1,frametimes+5 do
- local item = items[math.random(#items)]
- local newsapme = script.Parent.Unboxing.SempleItem:Clone()
- newsapme.Visible =true
- newsapme.Parent = script.Parent.Unboxing.inner
- newsapme.ItemName.Text = item.Name
- newsapme.Position = UDim2.new(0,100*(i-1),0,0)
- if i == frametimes then
- rewardbutton = newsapme
- end
- end
- for num = 1,(rewardbutton.Position.X.Offset - (255+math.random(-40,40)))/15 do
- for i,v in pairs(script.Parent.Unboxing.inner:GetChildren()) do
- v.Position = UDim2.new(0,v.Position.X.Offset -15,0,0)
- if v.Position.X.Offset <= -150 then
- v:Destroy()
- end
- end
- wait(0.01 * 1.05 ^ (num-105)/2)
- end
- end
- end
- opencrate(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement