Though no errors appear, it is simply not printing what I need it to. Full script:
local b = script.Parent
local screen = b.Parent.Screen
local hats = {["Euro 180"] = 401464679, ["Gold Ollie"] = 401464681, ["Red Grind"] = 401464684, ["Purple Indy"] = 401464683, ["Star Tailslide"] = 401464687}
local pose = {"Euro 180", "Gold Ollie", "Red Grind", "Purple Indy", "Star Tailslide"}
local db = false
local price = 100000
b.ClickDetector.MouseClick:connect(function(plr)
if db == false then
db = true
if plr.leaderstats.Coins.Value >= price then
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value - price
for key, v in pairs(hats) do
for i = .1, 4 do
wait(.1)
screen.item.Texture = "rbxassetid://"..hats[pose[math.random(1, #pose)]]
end
end
local num = screen.item.Texture:sub(14)
for key, v in pairs(hats) do
if num == hats[key] then
print("Won a "..key.." // id="..v)
end
end
db = false
end
end
end)
Part not working:
local num = screen.item.Texture:sub(14)
for key, v in pairs(hats) do
if num == hats[key] then
print("Won a "..key.." // id="..v)
end
end
