local buttonPressed = false
function OnHit(hit)
if hit.Parent ~= nil then
if not buttonPressed then
buttonPressed = true
local player = game.Players:playerFromCharacter()
local msg = "This Player has completed the course."
game.ReplicatedStorage.FilteringFunction:InvokeServer(msg)
print("Works!")
wait(4)
buttonPressed = false
end
end
end
script.Parent.Touched:connect(OnHit)
local webhook = ""
local filteringFunction = game.ReplicatedStorage.FilteringFunction
local HTTP = game:GetService("HttpService")
function filteringFunction.OnServerInvoke(player, msg)
local payload = HTTP:JSONEncode({
content = msg,
username = player.Name.." - (#"..player.UserId..")"
})
HTTP:PostAsync(webhook, payload)
end