Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plankNumber = script.Parent.PlankNumber
- local PlanksModel = script.Parent
- local PutPart = PlanksModel.PutPart
- local MaxNumber = 10
- PutPart.BillboardGui.countLabel.Text = plankNumber.Value.."/"..MaxNumber
- PutPart.ProximityPrompt.Triggered:Connect(function(player)
- local plank = player.Character:FindFirstChild("Plank") or player.Backpack:FindFirstChild("Plank")
- plank.stacks.Value -= 1
- plankNumber.Value += 1
- script.plankSound:Play()
- PutPart.BillboardGui.countLabel.Text = plankNumber.Value.."/"..MaxNumber
- if plankNumber.Value >= 1 then
- PlanksModel.Plank.Transparency = 0
- end
- if plankNumber.Value >= 2 then
- PlanksModel.Plank1.Transparency = 0
- end
- if plankNumber.Value >= 3 then
- PlanksModel.Plank2.Transparency = 0
- end
- if plankNumber.Value >= 4 then
- PlanksModel.Plank3.Transparency = 0
- end
- if plankNumber.Value >= 5 then
- PlanksModel.Plank4.Transparency = 0
- end
- if plankNumber.Value >= 6 then
- PlanksModel.Plank5.Transparency = 0
- end
- if plankNumber.Value >= 7 then
- PlanksModel.Plank6.Transparency = 0
- end
- if plankNumber.Value >= 8 then
- PlanksModel.Plank7.Transparency = 0
- end
- if plankNumber.Value >= 9 then
- PlanksModel.Plank8.Transparency = 0
- end
- if plankNumber.Value >= MaxNumber then
- PlanksModel.Plank9.Transparency = 0
- PutPart.ProximityPrompt.MaxActivationDistance = 0
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment