because when i press spin... i should have the money to buy the crate.... but if i don't how do i not activate the crate.... because i have no money... still i can spin and get items from the crate... nothings wrong with the script, but how do i put the code in the script?
Here's the code: local list = {
}
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)

4 comments
here's the thing i put it in a dialog shop,then the gui appears, then spin button is there. if i press it, if i have the money or not to but the crate, it still spins. how do i put that in the script?
thank you! plz add me so i can give u something in the game in the future
Alrighty, adding you. Feel free to contact me if you need any more help.
Edited the Answer to your question. Check it out.