Crate script wont work second time

so this happened to me with an older script i made for the same game, same problem.
i want it to work twice, but it only works once.
script:

local BeesNStuff = {
	[1] = {["Name"] = "Basic Bee", ["Obj"] = game.ServerStorage.Bees["Basic Bee"], ["Desc"] = "Loves buzzing around all day long.", ["Img"] = 0},
}
local Bee = BeesNStuff[math.random(1, #BeesNStuff)]
script.Parent.Triggered:Connect(function(Player)
	if Player.leaderstats.Honey.Value >= 0 then
		--Player.leaderstats.Honey.Value -= 0
		--[[
		Player["New Bie"].Value = game.ServerStorage.Bees["Basic Bee"]
				Player.PlayerGui.ScreenGui.Frame.Visible = true
		Player.PlayerGui.ScreenGui.Background.Visible = true
		Player.PlayerGui.ScreenGui.Frame.Title.Text = ""
		Player.PlayerGui.ScreenGui.Frame.Description.Text = ""
		Player.PlayerGui.ScreenGui.Frame.ImageLabel.Image = "rbxassetid://"
		]]
		--Player["New Bie"].Value = game.ServerStorage.Bees:WaitForChild(Bee.Obj)
		Player.PlayerGui.ScreenGui.Frame.Visible = true
		Player.PlayerGui.ScreenGui.Background.Visible = true
		Player.PlayerGui.ScreenGui.Frame.Title.Text = Bee.Name
		Player.PlayerGui.ScreenGui.Frame.Description.Text = Bee.Desc
		Player.PlayerGui.ScreenGui.Frame.ImageLabel.Image = "rbxassetid://" .. Bee.Img
	end
end)

youre only setting the random bee to the variable when the script runs (it will always stay the same) , put the Bee variable inside of the event

good idea, but it didnt fix the problem.

Could it be that your BeesNStuff only has one item inside of it so it keeps returning the same item?

1 Like

nevermind i fixed it
it required remoteevents
heres the game btw

good thing that you fixed it!

also, I’m bored so I’ll test your game if it’s public

1 Like

it is :smiley:
i just updated it with a new bee
give bee suggestions pls! :smiley:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.