Convert Table to String

currently working on a new project. finally got to messing around with module scripts in order to organize my code.

here is the main script that i’m using to spawn in maps for minigames.


 -- Services --

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterGui = game:GetService("StarterGui")

-- Modules --

local RoundModule = require(script.RoundModule)

-- Guis --

local StatusGui = StarterGui:WaitForChild("StatusGui")

-- Variables --

local IntermissionTime = 15
local VotingTime = 10
local RoundTime
local AbleToWin = true

local StatusValue = ReplicatedStorage:WaitForChild("Values"):FindFirstChild("StatusValue")

-- Folders --

local Minigames = ReplicatedStorage:WaitForChild("Minigames"):GetChildren()
local CurrentMinigames = game:GetService("Workspace"):WaitForChild("CurrentMinigames")
local InGameFolder = game:GetService("Workspace"):WaitForChild("InGameFolder")

-- Tables --

local WinnersTable = {}

-- Script --

while true do
	
	IntermissionTime = 15
	
	repeat
	IntermissionTime -= 1
	
	StatusValue.Value = "Intermission: "..IntermissionTime
	task.wait(1)
	until IntermissionTime == 0
	
	print("Starting round.")
	StatusValue.Value = "Round starting..."
	task.wait(1)
	StatusValue.Value = "Round starting.."
	task.wait(1)
	StatusValue.Value = "Round starting."
	task.wait(1)
	StatusValue.Value = "Round starting"

	local RandomMinigame = math.random(1, #Minigames)
	local ChosenMinigame = Minigames[RandomMinigame]:Clone()
	ChosenMinigame.Parent = CurrentMinigames

	local Players = game:GetService("Players"):GetChildren()
	
	for i = 1, #Players do
		if Players[i].Character ~= nil then
			local RandomTeleportPoint = math.random(1, #ChosenMinigame:WaitForChild("TeleportPoints"):GetChildren())
			Players[i].Character.Head.CFrame = ChosenMinigame.TeleportPoints[RandomTeleportPoint].CFrame
			Players[i].Character.Parent = InGameFolder
		end
	end
	
	RoundTime = 10
	AbleToWin = true
	
	if ChosenMinigame:WaitForChild("ObstacleRace") then
		ChosenMinigame:WaitForChild("EndPoint").Touched:Connect(function(Hit)
			if Hit.Parent:FindFirstChild("Humanoid") then
				if AbleToWin == true then
					AbleToWin = false
					local Winner = game:GetService("Players"):GetPlayerFromCharacter(Hit.Parent)
					table.insert(WinnersTable, Winner.Name)
				end
			end
		end)
	end
	
	if ChosenMinigame:WaitForChild("Maze") then
		ChosenMinigame:WaitForChild("EndPoint").Touched:Connect(function(Hit)
			if Hit.Parent:FindFirstChild("Humanoid") then
				if AbleToWin == true then
					local Winner = game:GetService("Players"):GetPlayerFromCharacter(Hit.Parent)
					table.insert(WinnersTable, Winner.Name)
				end
			end
		end)
	end
	
	repeat
		RoundTime -= 1
		StatusValue.Value = "Round over in: "..RoundTime
		task.wait(1)
	until RoundTime == 0 or AbleToWin == false or #InGameFolder:GetChildren() == 0
	
	task.wait(3)
	StatusValue.Value = "Winners: " -- This is where I need help.
	
	RoundModule.NewRound()
	
	task.wait(3)
end

the issue with this is that i’m at an intermediate level with scripting at this point, and have no clue how to convert a table into string… obviously :sweat_smile:

any help would be appreciated.

1 Like

of course right as i’m about to test this roblox studio crashes :person_facepalming: restarting right now. thanks!

1 Like

awesome, worked perfectly. thanks! :heart::heart:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.