This script is not currently working, it has the Add Tag and the Weld 2.1 installed in it. Is this correct?
script.Parent.ClickDetector.MouseClick:connect(function(p)
local tool = p.Backpack:findFirstChild("Case")
if (tool ~= nil) then
local tooleq = tool:findFirstChild("EquippedV")
if (tooleq ~= nil) then
if tooleq.Value == false then
local model = Instance.new("Model")
model.Name = "Case"
local decs = tool:GetChildren()
for _,v in pairs (decs) do
if v:IsA("BasePart") then
v.Parent = model
v.Anchored = true
v.CanCollide = true
end
end
tool:destroy()
model.Parent = game.Workspace
model:MoveTo(script.Parent.Position)
function TransformModel(objects, center, new, recurse)
for _,object in pairs(objects) do
if object:IsA("BasePart") then
object.CFrame = new:toWorldSpace(center:toObjectSpace(object.CFrame))
end
if recurse then
TransformModel(object:GetChildren(), center, new, true)
end
end
end
local center = model:GetModelCFrame()
TransformModel(
model:GetChildren(),
center,
center * CFrame.Angles(0,math.rad(90),math.rad(90)),
true
)
local cd = Instance.new("ClickDetector")
cd.Parent = model
local tags = script.Parent.AddTag:Clone()
tags.Parent = model
tags.Disabled = false
local welds = script["Weld 2.1"]:clone()
welds.Parent = model
welds.Disabled = false
script.Parent.ClickDetector.MaxActivationDistance = 0
script.Parent.Transparency = 1
wait(15)
script.Parent.ClickDetector.MaxActivationDistance = 32
script.Parent.Transparency = 0.8
else
local casecolour = tool.Handle.BrickColor
local newcase = game.ServerStorage.Case:Clone()
local model = Instance.new("Model")
model.Name = "Case"
local decs = newcase:GetChildren()
for _,v in pairs (decs) do
if v:IsA("BasePart") then
v.Parent = model
v.Anchored = true
v.CanCollide = true
if v.Name == "Handle" then
v.BrickColor = casecolour
end
end
end
newcase:destroy()
model.Parent = game.Workspace
model:MoveTo(script.Parent.Position)
local tool = p.Backpack:findFirstChild("Case")
if (tool ~= nil) then
tool:remove()
end
function TransformModel(objects, center, new, recurse)
for _,object in pairs(objects) do
if object:IsA("BasePart") then
object.CFrame = new:toWorldSpace(center:toObjectSpace(object.CFrame))
end
if recurse then
TransformModel(object:GetChildren(), center, new, true)
end
end
end
local center = model:GetModelCFrame()
TransformModel(
model:GetChildren(),
center,
center * CFrame.Angles(0,math.rad(90),math.rad(90)),
true
)
local cd = Instance.new("ClickDetector")
cd.Parent = model
local tags = script.Parent.AddTag:Clone()
tags.Parent = model
tags.Disabled = false
local welds = script["Weld 2.1"]:clone()
welds.Parent = model
welds.Disabled = false
script.Parent.ClickDetector.MaxActivationDistance = 0
script.Parent.Transparency = 1
wait(15)
script.Parent.ClickDetector.MaxActivationDistance = 32
script.Parent.Transparency = 0.8
end
end
end
end)

2 comments
What errors do you get? What output, if any, do you get?
It just doesn't work; the bag doesn't appear.