mirror of
				https://github.com/LDDestroier/CC/
				synced 2025-10-31 15:32:59 +00:00 
			
		
		
		
	Update tron.lua
This commit is contained in:
		
							
								
								
									
										11
									
								
								tron.lua
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								tron.lua
									
									
									
									
									
								
							| @@ -73,6 +73,7 @@ end | |||||||
| local tArg = {...} | local tArg = {...} | ||||||
| local useSkynet = (tArg[1] or ""):lower() == "skynet" | local useSkynet = (tArg[1] or ""):lower() == "skynet" | ||||||
| local useOnce = (tArg[2] or tArg[1] or ""):lower() == "quick" | local useOnce = (tArg[2] or tArg[1] or ""):lower() == "quick" | ||||||
|  | local argumentName = tArg[3] or tArg[2] or tArg[1] or nil | ||||||
| local skynetPath = "skynet" | local skynetPath = "skynet" | ||||||
| local skynetURL = "https://raw.githubusercontent.com/osmarks/skynet/master/client.lua" | local skynetURL = "https://raw.githubusercontent.com/osmarks/skynet/master/client.lua" | ||||||
|  |  | ||||||
| @@ -790,6 +791,7 @@ end | |||||||
| local sendInfo = function(gameID) | local sendInfo = function(gameID) | ||||||
| 	transmit(port, { | 	transmit(port, { | ||||||
| 		player = isHost and player or nil, | 		player = isHost and player or nil, | ||||||
|  | 		name = player[you].name, | ||||||
| 		putTrail = isPuttingDown, | 		putTrail = isPuttingDown, | ||||||
| 		gameID = gameID, | 		gameID = gameID, | ||||||
| 		keysDown = isHost and nil or keysDown, | 		keysDown = isHost and nil or keysDown, | ||||||
| @@ -893,6 +895,9 @@ end | |||||||
| local game = function() | local game = function() | ||||||
| 	local outcome | 	local outcome | ||||||
| 	local p, np | 	local p, np | ||||||
|  | 	if argumentName then | ||||||
|  | 		player[you].name = argumentName | ||||||
|  | 	end | ||||||
| 	while true do | 	while true do | ||||||
| 		if isHost then | 		if isHost then | ||||||
| 			sleep(gameDelay) | 			sleep(gameDelay) | ||||||
| @@ -977,8 +982,9 @@ local networking = function() | |||||||
|                     return gameID |                     return gameID | ||||||
|  |  | ||||||
| 				elseif msg.gameID == gamename then | 				elseif msg.gameID == gamename then | ||||||
| 					if not isHost then |  | ||||||
| 					if type(msg.player) == "table" then | 					if type(msg.player) == "table" then | ||||||
|  | 						if not isHost then | ||||||
|  | 							player[nou].name = msg.name or player[nou].name | ||||||
| 							player = msg.player | 							player = msg.player | ||||||
| 							if msg.trail then | 							if msg.trail then | ||||||
| 								for i = 1, #msg.trail do | 								for i = 1, #msg.trail do | ||||||
| @@ -987,11 +993,12 @@ local networking = function() | |||||||
| 							end | 							end | ||||||
| 							deadGuys = msg.deadGuys | 							deadGuys = msg.deadGuys | ||||||
| 							os.queueEvent("move_tick") | 							os.queueEvent("move_tick") | ||||||
| 						end |  | ||||||
| 						elseif type(msg.keysDown) == "table" then | 						elseif type(msg.keysDown) == "table" then | ||||||
| 							netKeysDown = msg.keysDown | 							netKeysDown = msg.keysDown | ||||||
| 							netLastDirectionPressed = msg.lastDir | 							netLastDirectionPressed = msg.lastDir | ||||||
| 							player[nou].putTrail = msg.putTrail | 							player[nou].putTrail = msg.putTrail | ||||||
|  | 							player[nou].name = msg.name or player[nou].name | ||||||
|  | 						end | ||||||
| 					end | 					end | ||||||
| 				end | 				end | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 LDDestroier
					LDDestroier