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.