yes i know i have already posted it but then deleted it coz i thought i found a solution (i didnt :/) so this is a crate opening system script and it doesnt work however im not getting any errors. i know its long but when u look deeper into it u will notice that its rly basic. any help appreciated!
local button = script.Parent
local cratedrops = game.StarterGui.CrateDrops
local plr = game.Players:WaitForChild(game.Workspace:WaitForChild("PlayerName").Value)
button.MouseButton1Click:Connect(function()
script.Parent.Parent.Parent.Crates.Visible = false
script.Parent.Parent.Parent.CurrentCrate.Visible = false
script.Parent.Parent.Parent.CurrentCrate.CrateNameValue.Value = "not chosen"
script.Parent.Parent.Parent.CurrentCrate.CrateImage.Image = script.Parent.Parent.Parent.Crates.BasicCrate.ImageLabel.Image
script.Parent.Parent.Parent.CurrentCrate.Amount.Text = "You Own 0"
script.Parent.Parent.Parent.CurrentCrate.Currency.Value = 30303
script.Parent.Parent.Parent.CurrentCrate.PriceValue.Value = 0
script.Parent.Parent.Parent.CurrentCrate.BoxName.Text = "Choose A Crate"
if script.Parent.Parent.CrateNameValue.Value == "Basic" then
local basicdrops = game.StarterGui.Crates.Crates.BasicCrate.Drops.Basic:GetChildren()
local novadrops = game.StarterGui.Crates.Crates.BasicCrate.Drops.Nova:GetChildren()
local stardrops = game.StarterGui.Crates.Crates.BasicCrate.Drops.Star:GetChildren()
local choosenitem
if plr:WaitForChild("Crates"):WaitForChild("Basic").Value > 0 then
plr:WaitForChild("Crates"):WaitForChild("Basic").Value = plr:WaitForChild("Crates"):WaitForChild("Basic").Value - 1
local chance = math.random(1,100)
if chance >= 15 then
choosenitem = basicdrops[math.random(1,#basicdrops)]
elseif chance < 15 and chance > 1 then
choosenitem = novadrops[math.random(1,#novadrops)]
elseif chance == 1 then
choosenitem = stardrops[math.random(1,#stardrops)]
end
cratedrops.DropImage.Image = cratedrops.Drops:FindFirstChild(choosenitem.Name).Image
cratedrops.DropName.Text = "You got "..choosenitem.Parent.Name .."Tier "..choosenitem.Name"!"
cratedrops.DropImage.Visible = true
cratedrops.DropName.Visible = true
plr:FindFirstChild("Inventory"):FindFirstChild(choosenitem.Name).Value = plr:FindFirstChild("Inventory"):FindFirstChild(choosenitem.Name).Value + 1
wait(4)
cratedrops.DropImage.Visible = false
cratedrops.DropName.Visible = false
end
end
end)

9 comments
ok ill try sorry for late comment
welp same issue :/ doesnt work, no errors
welp ima go sleep and check the answers tomorrow i guess
Are you sure the locations & stuff is right? Keep trying to find solutions. Try other things aswell and see if they will work.
ok ima try later
i think i would get errors if there was a wrong location
if i change starter guis to player gui and press open it changes all the values like price, crate name or currency value but it doesnt turn off guis, doesnt show the animation, doesnt give player the item and doesnt take away 1 basic crate
I'm sorry, I don't know what it could be. You should ask on the ScriptingHelpers discord.
ok i can try