when ever it stops spinning, the it should print what I got, and it does, but instead of printing the text in the frame of what I won, it prints something else
game:GetService("ReplicatedStorage").Remote.Unbox.OnServerEvent:Connect(function(plr, item)
if item == 777 then
local gold = plr:FindFirstChild("leaderstats").Gold
if gold.Value >= 1500 then
gold.Value = gold.Value - 1500
local g = game:GetService("ServerStorage").Gui:FindFirstChild("Unboxing"):Clone()
g.Parent = plr.PlayerGui:FindFirstChild("DevilSpin")
local Raritytimes = {
["I"] = 25,
["H"] = 22,
["G"] = 19,
["F"] = 16,
["E"] = 14,
["D"] = 12,
["C"] = 8,
["B"] = 5,
["A"] = 1,
}
local CrateInude = false
if CrateInude == false then
CrateInude = true
local items = {}
local frametimes = math.random(30,32)
local rewardbutton
for i,v in pairs(game.ServerStorage.Items:GetChildren()) do
local rarnumber = Raritytimes[v.Rarity.Value] or 1
local mathmatical = math.max(rarnumber)
for i = 1,mathmatical do
table.insert(items,v)
end
end
local sample = plr.PlayerGui:WaitForChild("DevilSpin"):FindFirstChild("Unboxing")
math.randomseed(tick())
for i = 1,frametimes+5 do
local item = items[math.random(#items)]
local newsapme = sample.SampleItem:Clone()
newsapme.Visible =true
newsapme.Parent = sample.inner
newsapme.Icon.Image = item.Image.Value
newsapme.ItemName.Text = item.Name
newsapme.Position = UDim2.new(0,115*(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(sample.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 ^ (num-100)/2)
end
local items = sample.inner:GetChildren()
local j
for i = 1, #items do
if items[i].Position.X.Offset - sample.inner.AbsoluteSize.X*0.5 < 0 and items[i].Position.X.Offset + 100 - sample.inner.AbsoluteSize.X*0.5 >= 0 then
j = i
sample.won.Text = items[i].ItemName.Text
print(items[i].ItemName.Text)
if items[i].ItemName.Text == "Fortune Fruit" then
local c = game.ServerStorage.ITEMS:FindFirstChild("Fortune Fruit"):Clone()
c:FindFirstChild("Owner").Value = plr.Name
c.Parent = plr.Backpack
local e = c:Clone()
e.Parent = plr.StarterGear
end
if items[i].ItemName.Text == "some other Fruit" then
local c = game.ServerStorage.ITEMS:FindFirstChild("some other Fruit"):Clone()
c:FindFirstChild("Owner").Value = plr.Name
c.Parent = plr.Backpack
local e = c:Clone()
e.Parent = plr.StarterGear
end
wait(3)
if sample.won.Text == items[i].ItemName.Text then
sample:Destroy()
end
end
end
end
end
end
end)
