Sungmingamerpro13

New Plank System for Story Games

Jul 25th, 2025
1,134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.51 KB | None | 0 0
  1. local plankNumber = script.Parent.PlankNumber
  2. local PlanksModel = script.Parent
  3. local PutPart = PlanksModel.PutPart
  4.  
  5. local MaxNumber = 10
  6.  
  7. PutPart.BillboardGui.countLabel.Text = plankNumber.Value.."/"..MaxNumber
  8.  
  9. PutPart.ProximityPrompt.Triggered:Connect(function(player)
  10.  
  11.     local plank = player.Character:FindFirstChild("Plank") or player.Backpack:FindFirstChild("Plank")
  12.  
  13.     plank.stacks.Value -= 1
  14.     plankNumber.Value += 1
  15.     script.plankSound:Play()
  16.  
  17.     PutPart.BillboardGui.countLabel.Text = plankNumber.Value.."/"..MaxNumber
  18.  
  19.     if plankNumber.Value >= 1 then
  20.         PlanksModel.Plank.Transparency = 0
  21.     end
  22.  
  23.     if plankNumber.Value >= 2 then
  24.         PlanksModel.Plank1.Transparency = 0
  25.     end
  26.  
  27.     if plankNumber.Value >= 3 then
  28.         PlanksModel.Plank2.Transparency = 0
  29.     end
  30.  
  31.     if plankNumber.Value >= 4 then
  32.         PlanksModel.Plank3.Transparency = 0
  33.     end
  34.  
  35.     if plankNumber.Value >= 5 then
  36.         PlanksModel.Plank4.Transparency = 0
  37.     end
  38.  
  39.     if plankNumber.Value >= 6 then
  40.         PlanksModel.Plank5.Transparency = 0
  41.     end
  42.  
  43.     if plankNumber.Value >= 7 then
  44.         PlanksModel.Plank6.Transparency = 0
  45.     end
  46.  
  47.     if plankNumber.Value >= 8 then
  48.         PlanksModel.Plank7.Transparency = 0
  49.     end
  50.  
  51.     if plankNumber.Value >= 9 then
  52.         PlanksModel.Plank8.Transparency = 0
  53.     end
  54.  
  55.     if plankNumber.Value >= MaxNumber then
  56.         PlanksModel.Plank9.Transparency = 0
  57.         PutPart.ProximityPrompt.MaxActivationDistance = 0
  58.     end
  59.  
  60. end)
Advertisement
Add Comment
Please, Sign In to add comment