Hi! So I need help making an object flip upside down in the replicated storage. It is a Admin Command where you type in ;boxtrap me and it adds a box for where you are but the box isn’t placing.
here’s my explorer
here’s my script
local Target = nil
local Box = game.ReplicatedStorage.Box:Clone()
local Valid = CheckForTarget(Target)
if Valid then
Box.CFrame = Target.Character.HumanoidRootPart.CFrame
wait(15)
Box:Destroy()
end
Click on the box, then go to the properties tab. Tap on “Primary Part” in the properties tab, then tap on one of the parts on the box. That should set the primary part. If you look at the following screen shot, it is right above “behavior” and right below “Parent”.
For this error, you have to assign a primary part to use :SetPrimaryPartCFrame()
I would suggest using this code:
local Target = nil
local Box = game.ReplicatedStorage.Box:Clone()
local Valid = CheckForTarget(Target)
if Valid then
Box.Parent = workspace
for _,v in pairs(Box:GetDescendants()) do
if v:IsA("BasePart") then
Box.PrimaryPart = v
break
end
end
Box:SetPrimaryPartCFrame(Target.Character.HumanoidRootPart.CFrame)
wait(15)
Box:Destroy()
end