So I am making a Baldi’s Basics game, I was trying to make it so that when you collect all notebooks (which in my case, are computers) the “Congratulations!” voice line plays,
but, for some reason, the script won’t do anything! It works but at the same time does not!
Here is my script:
game.Players.PlayerAdded:Connect(function(plr)
local computers = plr:WaitForChild("leaderstats").Computers
if computers.Value == 7 then
game.Workspace.Congratulations:Play(2)
end
end)
If there’s anything wrong in this script please tell me! Also yes, I know, it’s effortless indeed.
No problem!
If you want the script to react to changes of the value you can do this
game.Players.PlayerAdded:Connect(function(plr)
local computers = plr:WaitForChild("leaderstats").Computers
computers.Changed:Connect(function(NewVal)
if NewVal == 7 then
game.Workspace.Congratulations:Play(2)
end
end)
end)