Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How come my Discord webhook donation script isn't working?

So basically this script is supposed to make it so when a player has donated 5+ robux it sends a message on Discord telling the moderators to give them the Donator role. When I test the game it gives this error 'ServerScriptService.Discord Webhook:15: ')' expected (to close '(' at line 4) near 'end''. How would I fix this?

local url = 'https://discord.osyr.is/api/webhooks/removedcodeforsecurity'
local http = game:GetService("HttpService")

game.Players.PlayerAdded:Connect(function(player)
	wait(1)
	repeat wait() until player.leaderstats.Donated.Value == 0
		repeat wait() until player.leaderstats.Donated.Value >= 5
			local data = {
				['username'] = "???? NEW DONATION ????",
				['content'] = "Looks like, **".. player.Name.. "** has donated over 5 Robux! Looks like they deserve the donator role <@roleidremovedforsecurity>!"
			}
			local newdata = http:JSONEncode(data)
			http:PostAsync(url,newdata)
	end
end)

1 comment

0

These errors are self explanatory

2 answers

✓ Accepted answer

too many end

game.Players.PlayerAdded:Connect(function(player)
    wait(1)
    repeat wait() until player.leaderstats.Donated.Value == 0
        repeat wait() until player.leaderstats.Donated.Value >= 5
            local data = {
                ['username'] = "???? NEW DONATION ????",
                ['content'] = "Looks like, **".. player.Name.. "** has donated over 5 Robux! Looks like they deserve the donator role <@roleidremovedforsecurity>!"
            }
            local newdata = http:JSONEncode(data)
            http:PostAsync(url,newdata)
end)

1 comment

0

ty

This discussion is preserved as it was. New answers, comments, and votes are closed.