Why is this script erroring?

I’m making a script that works in every server. This script will fire an event, that event makes a ChatMessage.
However one of the arguments, if missing, it won’t have a custom color, the script makes it so if there’s no argument, it just puts the color as red. So I decided to try making it work, but I get the error:

ServerScriptService.Moderation.WebHooks:126: attempt to index nil with ‘Data’

Scripts:

function runSCWin(towerName,serverMessage)
    script.SM.Value = serverMessage
    script.TowerN.Value = towerName
    print(script.SM.Value)
    print(script.TowerN.Value)
	game:GetService("MessagingService"):PublishAsync("SCWin",{m=tostring(script.SM.Value),m2=tostring(script.TowerN.Value)})
end
	game:GetService("MessagingService"):SubscribeAsync('SCWin',function(mdata,m2data)
		local message = mdata.Data.m
		local message2 = m2data.Data.m
		if message and message2 then
			print("Message Recieved! "..message)
			print("Message Recieved! "..message2)
			local v2 = true
			game.ReplicatedStorage.ServerMessage:FireAllClients(message,message2,sc)
		end
	end)

PS: It errors when trying to add/use mdata2, but works with mdata somehow

On the second script, make sure mdata and m2data are not nil (use prints) and make sure m is a valid child of the two values.

mdata isn’t nil, but somehow m2data is even tho i just copied how mdata works

m2data is where the problem is. Double check and make sure the value you assign to it exists.

tostring(script.TowerN.Value)

This bit must be returning nil, I assume the value is a type which cannot be converted into a string through the tostring() function (which as a result returns nil).

script.TowerN.Value
What type of value instance is “TowerN” referencing?

print(script.TowerN.Value)
print(tostring(script.TowerN.Value))

This should help you debug.