local Player = game.Players.LocalPlayer
local Backpack = Player.Backpack
local PromptPurchase = game.ReplicatedStorage.PromptPurchase
local ItemDecoy = script.Item
local Holder = script.Parent.Holder
local BackpackItems = Backpack:GetChildren()
table.sort(BackpackItems,function(a,b)
return a.Config.Price.Value < b.Config.Price.Value
end)
local Guns = Player.Guns
local MeleeWeapons = Player.MeleeWeapons
local Primary = Player.Primary
local Secondary = Player.Secondary
local Melee = Player.Melee
repeat wait() until game:IsLoaded()
local function rotate(o)
local i = TweenInfo.new(5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,-1,false,0)
local g = {Orientation = Vector3.new(360,360,360)+o.Orientation}
game:GetService("TweenService"):Create(o,i,g):Play()
end
local function Update()
for i,v in pairs(Holder:GetChildren()) do
if v:IsA("Frame") then
v:Destroy()
end
end
for i,v in pairs(BackpackItems) do
local Item = ItemDecoy:Clone()
Item.Parent = Holder
Item.IName.Text = v.Name
Item.Buy.Text = "Purchase ("..v.Config.Price.Value..")"
local C = Instance.new("WorldModel")
for i,v in pairs(v:Clone():GetChildren()) do
v.Parent = C
if v:IsA("BasePart") then
v.Anchored = true
end
end
for i,v in pairs(C:GetDescendants()) do
if v:IsA("Script") or v:IsA("LocalScript") or v:IsA("ModuleScript") then
v.Disabled = true
end
end
C.PrimaryPart = C.Handle
C.Parent = Item.Image
rotate(C.Handle)
local Cam = Instance.new("Camera")
Cam.Parent = Item.Image
Item.Image.CurrentCamera = Cam
local dist = C:GetExtentsSize().Magnitude
Cam.CFrame = CFrame.new(C.Handle.Position+Vector3.new(0,0,dist),C.Handle.Position)
if string.find(Guns.Value,v.Name) or string.find(MeleeWeapons.Value,v.Name) then
Item.Buy.Text = "Equip"
end
if string.find(Primary.Value,v.Name) then
Item.Buy.Text = "Equipped (Primary)"
end
if string.find(Secondary.Value,v.Name) then
Item.Buy.Text = "Equipped (Secondary)"
end
if string.find(Melee.Value,v.Name) then
Item.Buy.Text = "Equipped (Melee)"
end
end
end
Update()
Primary.Changed:Connect(Update)
Secondary.Changed:Connect(Update)
Melee.Changed:Connect(Update)
Guns.Changed:Connect(Update)
Melee.Changed:Connect(Update)
I dont understand anything now. works like the same the bounding problem is fixed just the weld one is left
Joint instances break when you modify a part’s ‘Position’/‘Orientation’ properties like that. You can either rotate the tool’s bounding model itself via PivotTo or remove the WorldModel and instead rotate the camera 360 degrees around the tool’s bounding model.
OH I FORGOT ABOUT THE CAMERA. man how th are you so smart? Did you like red LuaU for like 10 years or something? I wanna know so I can be as genius as you are