MurderFries

mystery box

Nov 25th, 2020 (edited)
698
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. local RealPlayer = Player
  4. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  5.  
  6.  
  7. -- start script --
  8. model = Instance.new("Model",workspace)
  9. model.Name = "MysteryBox"
  10.  
  11. script.Parent = model
  12.  
  13. --[[
  14. leftoverPart6 = workspace:FindFirstChild("really_long_name_for_mystery_box_part_6_that_no_one_will_ever_use_except_for_me")
  15. ]]--
  16.  
  17. if leftoverPart6 then leftoverPart6:Destroy() end
  18.  
  19. -- asset build --
  20.  
  21. plr = game.Players.LocalPlayer
  22. char = plr.Character
  23. torso = char.Torso
  24.  
  25. part1 = Instance.new("Part",model)
  26. part1.Size = Vector3.new(4.5,3,3)
  27. part1.CFrame = CFrame.new(torso.CFrame.X + 3,torso.CFrame.Y + 6,torso.CFrame.Z + 3)
  28.  
  29. --[[physProp = PhysicalProperties.new(0.75, 20, 0.3, 1, 1)
  30. part1.CustomPhysicalProperties = physProp]]--
  31.  
  32. part1.Massless = true
  33.  
  34. p1x = part1.CFrame.X
  35. p1y = part1.CFrame.Y
  36. p1z = part1.CFrame.Z
  37.  
  38. part2 = Instance.new("Part",model)
  39. part2.Size = Vector3.new(4.6,1,3.1)
  40. part2.CFrame = CFrame.new(p1x,p1y,p1z)
  41.  
  42. part3 = Instance.new("Part",model)
  43. part3.Size = Vector3.new(4.8,1.2,1.2)
  44. part3.CFrame = CFrame.new(p1x,p1y,p1z)
  45.  
  46. part4 = Instance.new("Part",model)
  47. part4.Size = Vector3.new(1.2,1.2,3.2)
  48. part4.CFrame = CFrame.new(p1x,p1y,p1z)
  49.  
  50. part5 = Instance.new("Part",model)
  51. part5.Size = Vector3.new(4.8,3.3,3.3)
  52. part5.CFrame = CFrame.new(p1x,p1y,p1z)
  53. part5.Transparency = 1
  54.  
  55. part6 = Instance.new("Part",model)
  56. part6.Size = Vector3.new(0.1,0.1,0.1)
  57. part6.CFrame = CFrame.new(p1x,p1y + 5,p1z)
  58. part6.Transparency = 1
  59. part6.Name = "really_long_name_for_mystery_box_part_6_that_no_one_will_ever_use_except_for_me"
  60.  
  61. weld1 = Instance.new("Weld",model)
  62. weld1.Part0 = part1
  63. weld1.Part1 = part2
  64.  
  65. weld2 = Instance.new("Weld",model)
  66. weld2.Part0 = part1
  67. weld2.Part1 = part3
  68.  
  69. weld3 = Instance.new("Weld",model)
  70. weld3.Part0 = part1
  71. weld3.Part1 = part4
  72.  
  73. weld4 = Instance.new("Weld",model)
  74. weld4.Part0 = part1
  75. weld4.Part1 = part5
  76.  
  77. weld5 = Instance.new("Weld",model)
  78. weld5.Part0 = part1
  79. weld5.Part1 = part6
  80.  
  81. part1.TopSurface = Enum.SurfaceType.Smooth
  82. part1.BottomSurface = Enum.SurfaceType.Smooth
  83.  
  84. part2.TopSurface = Enum.SurfaceType.Smooth
  85. part2.BottomSurface = Enum.SurfaceType.Smooth
  86.  
  87. part3.TopSurface = Enum.SurfaceType.Smooth
  88. part3.BottomSurface = Enum.SurfaceType.Smooth
  89.  
  90. part4.TopSurface = Enum.SurfaceType.Smooth
  91. part4.BottomSurface = Enum.SurfaceType.Smooth
  92.  
  93. part2.CanCollide = false
  94. part3.CanCollide = false
  95. part4.CanCollide = false
  96. part5.CanCollide = false
  97. part6.CanCollide = false
  98.  
  99. part1.BrickColor = BrickColor.new("Shamrock")
  100. part2.BrickColor = BrickColor.new("Black")
  101. part3.BrickColor = BrickColor.new("New Yeller")
  102. part4.BrickColor = BrickColor.new("New Yeller")
  103.  
  104. part1.Material = Enum.Material.Metal
  105. part2.Material = Enum.Material.Marble
  106. part3.Material = Enum.Material.Slate
  107. part4.Material = Enum.Material.Slate
  108.  
  109. decal1 = Instance.new("Decal",part3)
  110. decal1.Texture = "rbxassetid://2276273"
  111. decal1.Face = Enum.NormalId.Left
  112.  
  113. decal2 = Instance.new("Decal",part3)
  114. decal2.Texture = "rbxassetid://2276273"
  115. decal2.Face = Enum.NormalId.Right
  116.  
  117. decal3 = Instance.new("Decal",part4)
  118. decal3.Texture = "rbxassetid://2276273"
  119. decal3.Face = Enum.NormalId.Back
  120.  
  121. decal4 = Instance.new("Decal",part4)
  122. decal4.Texture = "rbxassetid://2276273"
  123. decal4.Face = Enum.NormalId.Front
  124.  
  125. clickD = Instance.new("ClickDetector",part5)
  126.  
  127. sound = Instance.new("Sound",part5)
  128. sound.SoundId = "rbxassetid://5049406383"
  129. sound.Volume = 2
  130. sound.Looped = false
  131.  
  132. bGUI = Instance.new("BillboardGui",part6)
  133. bGUI.Enabled = false
  134. bGUI.MaxDistance = 30
  135. bGUI.Size = UDim2.new(0,200,0,500)
  136.  
  137. tBox = Instance.new("TextBox",bGUI)
  138. tBox.BackgroundTransparency = 1
  139. tBox.TextScaled = true
  140. tBox.TextColor3 = Color3.new(255,255,255)
  141. tBox.TextStrokeColor3 = Color3.new(0,0,0)
  142. tBox.TextStrokeTransparency = 0
  143. tBox.Text = "Label"
  144. tBox.Position = UDim2.new(0,0,0,0)
  145. tBox.Size = UDim2.new(0,400,0,100)
  146. tBox.Font = Enum.Font.SourceSansItalic
  147.  
  148. print("Box spawned at coordinates " ..p1x .. ", " .. p1y .. ", " .. p1z)
  149.  
  150. -- extra builds / box outcome builds --
  151.  
  152.  
  153.  
  154. -- function builds --
  155.  
  156. local function setText(text)
  157.     bGUI.Enabled = true
  158.     tBox.Text = "You got "..text
  159. end
  160.  
  161. local function Initialize()
  162.  
  163.     local rN = math.random(1,10)
  164.    
  165.     if rN == 1 then
  166.  
  167.         setText("Toad!")
  168.  
  169.         toadpart = Instance.new("Part",model)
  170.         toadpart.Size = Vector3.new(3.81, 4.6, 3.312)
  171.         toadpart.CFrame = CFrame.new(p1x,p1y + 5,p1z)
  172.  
  173.         toadmesh = Instance.new("SpecialMesh",toadpart)
  174.         toadmesh.MeshType = Enum.MeshType.FileMesh
  175.         toadmesh.TextureId = "rbxassetid://5038530309"
  176.         toadmesh.MeshId = "rbxassetid://5038530279"
  177.         toadmesh.Scale = Vector3.new(0.1, 0.1, 0.1)
  178.  
  179.         toadsound = Instance.new("Sound",toadpart)
  180.         toadsound.SoundId = "rbxassetid://2497573478"
  181.         toadsound.Volume = 2
  182.         toadsound.Looped = false
  183.  
  184.         toadsound:Play()
  185.  
  186.         wait(6)
  187.  
  188.         toadsound:Stop()
  189.         toadsound.SoundId = "rbxassetid://513492655"
  190.         toadsound:Play()
  191.  
  192.         wait(1)
  193.        
  194.         toadexp = Instance.new("Explosion",toadpart)
  195.         toadexp.BlastPressure = 0
  196.         toadexp.BlastRadius = 0
  197.         toadexp.DestroyJointRadiusPercent = 0
  198.         toadexp.Position = Vector3.new(toadpart.CFrame.X,toadpart.CFrame.Y,toadpart.CFrame.Z)
  199.  
  200.         toadpart.Transparency = 1
  201.  
  202.         wait(3)
  203.  
  204.         toadsound:Stop()
  205.  
  206.         wait(2)
  207.  
  208.         toadpart:Destroy()
  209.        
  210.     elseif rN == 2 then
  211.  
  212.         setText("an arrest warrant!")
  213.  
  214.         fbisound = Instance.new("Sound",clickS.Character.Torso)
  215.         fbisound.SoundId = "rbxassetid://4964334807"
  216.         fbisound.Volume = 5
  217.         fbisound.Looped = false
  218.  
  219.         fbisound:Play()
  220.  
  221.         wait(2)
  222.  
  223.         fbisound:Stop()
  224.         fbisound.SoundId = "rbxassetid://158712406"
  225.         fbisound:Play()
  226.  
  227.         wait(.75)
  228.  
  229.         clickS.Character:BreakJoints()
  230.  
  231.     elseif rN == 3 then
  232.  
  233.         script.Parent = clickS.Character
  234.  
  235.         setText("bloxy cola!")
  236.  
  237.         Tool = Instance.new("Tool",clickS.Character)
  238.  
  239.         Tool.GripForward = Vector3.new(-.976,0,-0.217)
  240.         Tool.GripPos = Vector3.new(0.03,0,0)
  241.         Tool.GripRight = Vector3.new(.217,0,-.976)
  242.         Tool.GripUp = Vector3.new(0,1,0)
  243.  
  244.         colapart = Instance.new("Part",Tool)
  245.         colapart.Size = Vector3.new(1, 1.2, 1)
  246.         colapart.CFrame = CFrame.new(p1x,p1y + 4,p1z)
  247.  
  248.         colapart.Name = "Handle"
  249.         Tool.Name = "Cola"
  250.  
  251.         Tool.TextureId = "http://www.roblox.com/asset/?id=10472127"
  252.  
  253.         colamesh = Instance.new("SpecialMesh",colapart)
  254.         colamesh.MeshType = Enum.MeshType.FileMesh
  255.         colamesh.TextureId = "rbxassetid://10470600"
  256.         colamesh.MeshId = "rbxassetid://10470609"
  257.         colamesh.Scale = Vector3.new(1.2, 1.2, 1.2)
  258.  
  259.         colaDrinkSound = Instance.new("Sound",colapart)
  260.         colaDrinkSound.SoundId = "rbxassetid://10722059"
  261.         colaDrinkSound.Volume = 1.25
  262.         colaDrinkSound.Looped = false
  263.  
  264.         colaOpenSound = Instance.new("Sound",colapart)
  265.         colaOpenSound.SoundId = "rbxassetid://10721950"
  266.         colaOpenSound.Volume = 1.25
  267.         colaOpenSound.Looped = false
  268.  
  269.         enabled = true
  270.         enabled2 = false
  271.  
  272.         function onActivated()
  273.         if not enabled  then
  274.             return
  275.         end
  276.  
  277.         enabled = false
  278.         Tool.GripForward = Vector3.new(0,-.759,-.651)
  279.         Tool.GripPos = Vector3.new(1.5,-.5,.3)
  280.         Tool.GripRight = Vector3.new(1,0,0)
  281.         Tool.GripUp = Vector3.new(0,.651,-.759)
  282.  
  283.  
  284.         colaDrinkSound:Play()
  285.  
  286.         wait(3)
  287.        
  288.         local h = Tool.Parent:FindFirstChild("Humanoid")
  289.         if (h ~= nil) then
  290.             if (h.MaxHealth > h.Health + 5) then
  291.                 h.Health = h.Health + 5
  292.             else   
  293.                 h.Health = h.MaxHealth
  294.             end
  295.         end
  296.  
  297.         Tool.GripForward = Vector3.new(-.976,0,-0.217)
  298.         Tool.GripPos = Vector3.new(0.03,0,0)
  299.         Tool.GripRight = Vector3.new(.217,0,-.976)
  300.         Tool.GripUp = Vector3.new(0,1,0)
  301.  
  302.         enabled = true
  303.  
  304.     end
  305.  
  306.     function onEquipped()
  307.         Tool.Handle.OpenSound:play()
  308.     end
  309.  
  310.    
  311.         function onEquipped()
  312.             if enabled2 == false then
  313.                 clickS.Character.Humanoid:UnequipTools()
  314.                 enabled2 = true
  315.                 print("enabled2 was false for cola")
  316.             else
  317.                 colaOpenSound:play()
  318.             end
  319.         end
  320.  
  321.         clickS.Character.Humanoid:UnequipTools()
  322.        
  323.         Tool.Activated:connect(onActivated)
  324.         Tool.Equipped:connect(onEquipped)
  325.  
  326.  
  327.     elseif rN == 4 then
  328.  
  329.         setText("gnomed!")
  330.  
  331.         gnomepart = Instance.new("Part",model)
  332.         gnomepart.Size = Vector3.new(4.5,7.5,0.05)
  333.         gnomepart.CFrame = CFrame.new(p1x,p1y - 2.5,p1z)
  334.         gnomepart.Anchored = true
  335.         gnomepart.CanCollide = false
  336.         gnomepart.Transparency = 1
  337.  
  338.         gnomedecal1 = Instance.new("Decal",gnomepart)
  339.         gnomedecal1.Texture = "rbxassetid://5197525736"
  340.         gnomedecal1.Face = Enum.NormalId.Front
  341.  
  342.         gnomedecal2 = Instance.new("Decal",gnomepart)
  343.         gnomedecal2.Texture = "rbxassetid://5197525736"
  344.         gnomedecal2.Face = Enum.NormalId.Back
  345.  
  346.         gnomesound = Instance.new("Sound",gnomepart)
  347.         gnomesound.SoundId = "rbxassetid://2521946636"
  348.         gnomesound.Volume = 1.25
  349.         gnomesound.Looped = false
  350.         gnomesound.PlaybackSpeed = 1.5
  351.  
  352.         gnomesound:Play()
  353.  
  354.         wait(10.2)
  355.  
  356.         gnomepart:Destroy()
  357.  
  358.     elseif rN == 5 then
  359.  
  360.         setText("some sick moves! Show them off!")
  361.  
  362.         dancesoundleftover = clickS.Character:FindFirstChild("mystery_box_dance_sound")
  363.         if dancesoundleftover then dancesoundleftover:Destroy() end
  364.  
  365.         anim = Instance.new("Animation",clickS.Character)
  366.  
  367.         local dancesoundids = {
  368.  
  369.             4708502893,
  370.             227479020,
  371.             297343361,
  372.             753096775,
  373.             2298566537,
  374.             525565668,
  375.             1386299751
  376.            
  377.         }
  378.        
  379.         anim.AnimationId = "rbxassetid://27789359"
  380.  
  381.         anim2 = clickS.Character.Humanoid:LoadAnimation(clickS.Character:FindFirstChildOfClass("Animation"))
  382.         anim2.Looped = true
  383.         anim2:Play()
  384.  
  385.         dancesound = Instance.new("Sound",clickS.Character.Torso)
  386.         dancesound.SoundId = "rbxassetid://" ..dancesoundids[math.random(#dancesoundids)]
  387.         dancesound.Volume = 0.7
  388.         dancesound.Looped = true
  389.         dancesound.name = "mystery_box_dance_sound"
  390.  
  391.         dancesound:Play()
  392.  
  393.     elseif rN == 6 then
  394.  
  395.         setText("a pet Brock!")
  396.  
  397.         cSx = clickS.Character.Torso.CFrame.X
  398.         cSy = clickS.Character.Torso.CFrame.Y
  399.         cSz = clickS.Character.Torso.CFrame.Z
  400.  
  401.         brockpart = Instance.new("Part",clickS.Character)
  402.         brockpart.Size = Vector3.new(2, 2, 2)
  403.         brockpart.CFrame = CFrame.new(cSz,cSy,cSz)
  404.         brockpart.Massless = true
  405.  
  406.         brockmesh = Instance.new("SpecialMesh",brockpart)
  407.         brockmesh.MeshType = Enum.MeshType.FileMesh
  408.         brockmesh.TextureId = "rbxassetid://21629620"
  409.         brockmesh.MeshId = "rbxassetid://21629626"
  410.         brockmesh.Scale = Vector3.new(1.6, 1.6, 1.6)
  411.         brockmesh.Offset = Vector3.new(-2,-2,3)
  412.  
  413.         brockpart.CanCollide = false
  414.        
  415.         brockweld = Instance.new("Weld",clickS.Character)
  416.         brockweld.Part0 = clickS.Character.Torso
  417.         brockweld.Part1 = brockpart
  418.  
  419.         brocksound = Instance.new("Sound",brockpart)
  420.         brocksound.SoundId = "rbxassetid://3123007321"
  421.         brocksound.Volume = 2.5
  422.         brocksound.Looped = false
  423.  
  424.         brocksound:Play()
  425.  
  426.     elseif rN == 7 then
  427.  
  428.         setText("TRIGGERED. It's okay, we have a plan for you!")
  429.  
  430.         if clickS.Character:FindFirstChildOfClass("Shirt") then
  431.             clickS.Character:FindFirstChildOfClass("Shirt").ShirtTemplate = "rbxassetid://5360950775"
  432.         else
  433.             Instance.new("Shirt",clickS.Character)
  434.             clickS.Character:FindFirstChildOfClass("Shirt").ShirtTemplate = "rbxassetid://5360950775"
  435.         end
  436.  
  437.         if clickS.Character:FindFirstChildOfClass("Pants") then
  438.             clickS.Character:FindFirstChildOfClass("Pants").PantsTemplate = "rbxassetid://5360995343"
  439.         else
  440.             Instance.new("Pants",clickS.Character)
  441.             clickS.Character:FindFirstChildOfClass("Pants").PantsTemplate = "rbxassetid://5360995343"
  442.         end
  443.  
  444.         trface = clickS.Character.Head:FindFirstChildOfClass("Decal")
  445.         if trface then
  446.             trface.Texture = "rbxassetid://168024772"
  447.         end
  448.  
  449.         trsound = Instance.new("Sound",clickS.character.Torso)
  450.         trsound.SoundId = "rbxassetid://3312970549"
  451.         trsound.Volume = 3
  452.         trsound.Looped = false
  453.  
  454.         trsound2 = Instance.new("Sound",clickS.character.Torso)
  455.         trsound2.SoundId = "rbxassetid://1080089636"
  456.         trsound2.Volume = 0.25
  457.         trsound2.Looped = true
  458.  
  459.         trsound:Play()
  460.  
  461.         wait(4)
  462.  
  463.         trsound:Stop()
  464.         trsound2:Play()
  465.  
  466.     elseif rN == 8 then
  467.  
  468.         setText("your health doubled!")
  469.  
  470.         dhhum = clickS.Character:FindFirstChildOfClass("Humanoid")
  471.  
  472.         dhhum.MaxHealth = dhhum.MaxHealth * 2
  473.         dhhum.Health = dhhum.Health * 2 - 1
  474.  
  475.         --[[dheffect = Instance.new("ParticleEmitter",clickS.Character.Torso)
  476.         dheffect.Transparency = NumberSequence.new(0.7,0.7)
  477.         dheffect.Size = NumberSequence.new(0.25,0.25)
  478.         dheffect.Texture = "rbxassetid://195459249"
  479.         --dheffect.Texture = "rbxasset://textures/particles/sparkles_main.dds"
  480.         dheffect.Lifetime = NumberRange.new(0.5,1)
  481.         dheffect.Rate = NumberSequence.new(30,30)
  482.         dheffect.Speed = NumberRange.new(5,5)
  483.         dheffect.SpreadAngle = Vector2.new(-20,20)
  484.         dheffect.EmissionDirection = Enum.NormalId.Top
  485.         dheffect.ZOffset = 0
  486.         dheffect.RotSpeed = NumberRange.new(0,0)
  487.         dheffect.Rotation = NumberRange.new(0,0)
  488.         dheffect.Acceleration = Vector3.new(0,0,0)
  489.  
  490.         dheffect.Enabled = true]]--
  491.  
  492.         dhsound = Instance.new("Sound",clickS.Character.Torso)
  493.         dhsound.SoundId = "rbxassetid://1582829611"
  494.         dhsound.Volume = 1.5
  495.         dhsound.Looped = false
  496.  
  497.         dhsound:Play()
  498.  
  499.         --dheffect.Enabled = false
  500.  
  501.     elseif rN == 9 then
  502.  
  503.         setText("a comically large spoon!")
  504.  
  505.         script.Parent = clickS.Character
  506.  
  507.         Tool2 = Instance.new("Tool",clickS.Character)
  508.  
  509.         Tool2.GripForward = Vector3.new(0, -1, 0)
  510.         Tool2.GripPos = Vector3.new(0, 0, 0.5)
  511.         Tool2.GripRight = Vector3.new(1, 0, 0)
  512.         Tool2.GripUp = Vector3.new(0, 0, -1)
  513.  
  514.         sppart = Instance.new("Part",Tool2)
  515.         sppart.Size = Vector3.new(1.4, 0.75, 6.3)
  516.         sppart.CFrame = CFrame.new(p1x,p1y + 4,p1z)
  517.  
  518.         sppart.Name = "Handle"
  519.         Tool2.Name = "Comically Large Spoon"
  520.  
  521.         enabled2_2 = false
  522.  
  523.         spmesh = Instance.new("SpecialMesh",sppart)
  524.         spmesh.MeshType = Enum.MeshType.FileMesh
  525.         spmesh.TextureId = "rbxassetid://2037260269"
  526.         spmesh.MeshId = "rbxassetid://431329906"
  527.         spmesh.Scale = Vector3.new(3, 3, 3)
  528.  
  529.         spOpenSound = Instance.new("Sound",sppart)
  530.         spOpenSound.SoundId = "rbxassetid://5178876770"
  531.         spOpenSound.Volume = 3.5
  532.         spOpenSound.Looped = false
  533.  
  534.         function onEquipped()
  535.             if enabled2_2 == false then
  536.                 clickS.Character.Humanoid:UnequipTools()
  537.                 enabled2_2 = true
  538.                 print("enabled2 was false for spoon")
  539.             else
  540.                 spOpenSound:play()
  541.             end
  542.         end
  543.  
  544.         clickS.Character.Humanoid:UnequipTools()
  545.  
  546.         Tool2.Equipped:connect(onEquipped)
  547.        
  548.     else
  549.         setText("absolutely nothing!")
  550.     end
  551.  
  552.     wait(2)
  553.  
  554.     part6:Destroy()
  555.  
  556. end
  557.  
  558. local function destroyDetails()
  559.  
  560.     part2:Destroy()
  561.     part3:Destroy()
  562.     part4:Destroy()
  563.  
  564. end
  565.  
  566. local function onClick(clickS2)
  567.  
  568.     clickD:Destroy()
  569.     sound:Play()
  570.  
  571.     clickS = clickS2
  572.  
  573.     bGUI.Enabled = true
  574.     tBox.Text = "Opening..."
  575.  
  576.     wait(.85)
  577.  
  578.     print("Box was opened by ".. clickS.Name .. ".")
  579.  
  580.     sound:Stop()
  581.  
  582.     part1.Anchored = true
  583.     part1.CanCollide = false
  584.     part1.Transparency = 1
  585.     destroyDetails()
  586.  
  587.     p1x = part1.CFrame.X
  588.     p1y = part1.CFrame.Y
  589.     p1z = part1.CFrame.Z
  590.  
  591.     Initialize()
  592.  
  593.     part1:Destroy()
  594.     part5:Destroy()
  595.  
  596. end
  597.  
  598. -- wrap up functions --
  599.  
  600. clickD.MouseClick:Connect(onClick)
  601.  
  602. -- end script --
  603.  
  604.  
  605.  
RAW Paste Data