local inventoryFrame = script.
Parent
local startgui = game:GetService("StarterGui")
local Players = game:GetService("Players")
local Player = [Link]
local mouse = Player:GetMouse()
local equipDb = false
local DataManagementModule = require([Link])
local ItemsModule = require([Link])
local itemFolder = game:GetService("ReplicatedStorage").[Link]
local runService = game:GetService("RunService")
local remotes = [Link]
local inventoryRemote = [Link]
local inventoryLoader = {}
function createViewport(template,v)
local viewport = [Link]
local camera = [Link]("Camera",viewport)
local model = [Link]("Model",viewport)
local handleClone = itemFolder[[Link]].Handle:Clone()
[Link] = true
[Link] = model
[Link] = handleClone
[Link] = camera
[Link] = [Link]*[Link]([Link](0,0,-
5),[Link](0,0,0))
[Link] = true
[Link] = [Link]
end
function setTemplateColor(template,itemName)
local connection
local lastTick = tick()
if ItemsModule[itemName].Rarity == "Common" then
[Link] = false
[Link] = [Link](0.705882, 0.705882, 0.705882)
elseif ItemsModule[itemName].Rarity == "Rare" then
[Link] = false
[Link] = [Link](0, 1, 0)
elseif ItemsModule[itemName].Rarity == "Epic" then
[Link] = false
[Link] = [Link](0.333333, 0, 1)
elseif ItemsModule[itemName].Rarity == "Legendary" then
[Link] = true
[Link] =
[Link]({[Link](0,[Link](255, 0,
0)),[Link](0.1,[Link](85, 170,
255)),[Link](0.2,[Link](255, 255,
0)),[Link](0.3,[Link](0, 255,
0)),[Link](0.4,[Link](255, 170,
255)),[Link](0.5,[Link](255, 0,
0)),[Link](0.6,[Link](85, 170,
255)),[Link](0.7,[Link](255, 255,
0)),[Link](0.85,[Link](0, 255,
0)),[Link](1,[Link](255, 170, 255))})
elseif ItemsModule[itemName].Rarity == "Treasure" then
[Link] = true
[Link] =
[Link]({[Link](0,[Link](0, 0,
0)),[Link](0.1,[Link](255, 255,
255)),[Link](0.2,[Link](0, 0,
0)),[Link](0.3,[Link](255, 255,
255)),[Link](0.4,[Link](0, 0,
0)),[Link](0.5,[Link](0, 0,
0)),[Link](0.6,[Link](255, 255,
255)),[Link](0.7,[Link](0, 0,
0)),[Link](0.85,[Link](255, 255,
255)),[Link](1,[Link](0, 0, 0))})
end
--border effect
if ItemsModule[itemName].Rarity == "Treasure" then
connection = [Link]:Connect(function(deltaTime)
if tick()-lastTick > 0.1 and
[Link] < 1000 then
[Link] += 1
lastTick = tick()
elseif [Link] >= 1000 then
[Link] = 0
end
end)
elseif ItemsModule[itemName].Rarity == "Legendary" then
connection = [Link]:Connect(function(deltaTime)
if tick()-lastTick > 0.1 and
[Link] < 1000 then
[Link] += 1
lastTick = tick()
elseif [Link] >= 1000 then
[Link] = 0
end
end)
end
-- end of border effect
return connection
end
function [Link](scroll)
local PlayerGui = [Link]
local FramesGui = [Link]
local InventoryFrame = [Link]
local getInventory = Player:WaitForChild("Inventory"):GetChildren()
for _,v in ipairs(getInventory) do
local template = nil
local templateColorConnection
inventoryRemote:FireServer([Link],[Link])
if [Link] >= 1 then
template = [Link]:Clone()
[Link] = [Link]
[Link] = scroll
[Link] = [Link]
templateColorConnection = setTemplateColor(template,[Link])
if itemFolder[[Link]]:FindFirstChild("Handle") then
createViewport(template,v)
else
[Link] = [Link]
end
[Link].MouseButton1Click:Connect(function()
[Link][[Link]].[Link] = not
[Link][[Link]].[Link]
if [Link][[Link]].[Link] == true and
equipDb == false then
equipDb = true
inventoryRemote:FireServer([Link],true)
wait(.25)
equipDb = false
elseif [Link][[Link]].[Link] == false
then
inventoryRemote:FireServer([Link],false)
end
end)
[Link] = "x"..[Link]
[Link] = true
else
if template then
if templateColorConnection ~= nil then
templateColorConnection:Disconnect()
end
template:Destroy()
[Link]:FireServer([Link],false)
[Link][[Link]].[Link] = false
end
end
-- makes the color border rotation dont run when inventory
invisible/closed
if [Link] == false then
if templateColorConnection ~= nil then
templateColorConnection:Disconnect()
end
else
if template then
templateColorConnection = setTemplateColor(template,[Link])
end
end
InventoryFrame:GetPropertyChangedSignal("Visible"):Connect(function()
if [Link] == false then
if templateColorConnection ~= nil then
templateColorConnection:Disconnect()
end
else
if template then
templateColorConnection =
setTemplateColor(template,[Link])
end
end
end) ---------------------------- end of border stop script
[Link]:Connect(function()
if [Link] >= 1 then
if template then -- removes the old template
template:Destroy()
end
template = [Link]:Clone()
[Link] = [Link]
[Link] = scroll
[Link] = [Link]
templateColorConnection = setTemplateColor(template,[Link])
if itemFolder[[Link]]:FindFirstChild("Handle") then
createViewport(template,v)
else
[Link] = [Link]
end
[Link].MouseButton1Click:Connect(function()
[Link][[Link]].[Link] = not
[Link][[Link]].[Link]
if [Link][[Link]].[Link] == true
and equipDb == false then
equipDb = true
inventoryRemote:FireServer([Link],true)
wait(.25)
equipDb = false
elseif [Link][[Link]].[Link] ==
false then
inventoryRemote:FireServer([Link],false)
end
end)
[Link] = "x"..[Link]
[Link] = true
else
if template then
if templateColorConnection ~= nil then
templateColorConnection:Disconnect()
end
template:Destroy()
[Link]:FireServer([Link],false)
[Link][[Link]].[Link] = false
end
end
end)
end
end
return inventoryLoader