Pet Cases and Gear Cases V1

Hi, this is a repost since the last one got closed. I made 2 pet / toy cases for pet and gear stuff where you can get random items here’s the Scripts:
Gear Case:

local p1 = game.ServerStorage.RocketLauncher
local p2 = game.ServerStorage.ClassicPaintballGun
local p3 = game.ServerStorage.ClassicSlingshot
local p4 = game.ServerStorage.ClassicSword
local p5 = game.ServerStorage.ClassicTimebomb
local p6 = game.ServerStorage.ClassicSuperball
local p7 = game.ServerStorage.ClassicTrowel
	local Part = script.Parent
local ClickDetector = Part:WaitForChild("ClickDetector")

ClickDetector.MouseClick:connect(function(Player)
	Player.Character.LowerTorso.CFrame = workspace.Location.CFrame
		local bp = Player:WaitForChild("Backpack")
		local p = math.random(1,7)
		if p == 1 then
			local prize = p1:Clone()
			prize.Parent = bp
		elseif p == 2 then
			local prize = p2
			prize.Parent = bp
		elseif p == 3 then
			local prize = p3
			prize.Parent = bp
		elseif p == 4  then
			local prize = p4
			prize.Parent = bp
		elseif p == 5 then
			local prize = p5
			prize.Parent = bp
		elseif p == 6 then
			local prize = p6
		prize.Parent = bp
	elseif p == 7 then
		local prize = p7
		prize.Parent = bp
		end
	end)

Pet Case:

local p1 = game.ServerStorage.Red
local p2 = game.ServerStorage.Orange
local p3 = game.ServerStorage.Yellow
local p4 = game.ServerStorage.Blue
local p5 = game.ServerStorage.Green
local Part = script.Parent
local ClickDetector = Part:WaitForChild("ClickDetector")

ClickDetector.MouseClick:connect(function(Player)
	local bp = Player:WaitForChild("Backpack")
	local p = math.random(1,5)
	if p == 1 then
		local prize = p1:Clone()
		prize.Parent = bp
	elseif p == 2 then
		local prize = p2
		prize.Parent = bp
	elseif p == 3 then
		local prize = p3
		prize.Parent = bp
	elseif p == 4  then
		local prize = p4
		prize.Parent = bp
	elseif p == 5 then
		local prize = p5
		prize.Parent = bp
	end
end)

Models:
Case V1 - Roblox - Workspace
Items V1 - Roblox - ServerStorage

Images:


No need to credit me just don’t claim it as yours.

5 Likes

Very nice. Thanks for the contribution.

2 Likes

pls dont use so many if statements

instead u could use

local Prize = Items[math.random(1,#Items)]:Clone()
Prize.Parent = Backpack

EDIT: I have forgotten to tell you what “Items” is.

local Items = game.ServerStorage.PrizeFolder:GetChildren()
1 Like

Like what @Nerbzzz said… using that much if statements is ridiculous and unnecessary.

Also isn’t reposting not allowed?

1 Like

It’s not another person’s work it’s my own last time mine got closed since I forgot to add the open-source script

I didn’t know how to use that before making this script

Yeah… I know it’s your work.

I was saying that reposting your work again isn’t allowed. Also, anyone can view the source code if it’s a model

I know but they shut down my last one saying not enough information