What you are using in your script is called an anonymous function.
When you create an anonymous function, you are actually placing everything in your code as a parameter of the "connect" method. You need to make sure that your opened parentheses are closed with a close parentheses at some point. In an anonymous function, this is typically done at the "end" that corresponds to the "connect" method.
Check this fixed script out:
game.Players.PlayerAdded:connect(function(player)
if game.GamePassService:PlayerHasPass(player,405307406) then
local cashmoney = game.ServerStorage.MoneyStorage:WaitForChild(player.Name)
cashmoney.Value = cashmoney.Value + 20000
end
end)
So in short, you just needed to have a closing parentheses after the last "and".
Comment if you have any questions!
2 comments
What is this? lol
What...