RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create an lootbox system, when open it expands to reveal the item"
-- server script local lootbox = script.Parent local canOpen = true local function openLootbox(otherPart) local partParent = otherPart.Parent local humanoid = partParent:FindFirstChildWhichIsA('Humanoid') if humanoid and canOpen then canOpen = false lootbox:SetPrimaryPartCFrame(lootbox.PrimaryPart.CFrame * CFrame.new(0, 0, 5)) wait(3) lootbox:SetPrimaryPartCFrame(lootbox.PrimaryPart.CFrame * CFrame.new(0, 0, -5)) canOpen = true end end lootbox.Touched:Connect(openLootbox)