I need to change the message to a Screen GUI.

timer = 10 -- Change this to the amount of seconds waited before a new map is chosen	
prefix = "" -- Whatever is in here will come before any messages appeared on screen

if Workspace:findFirstChild("MapsHere") ~= nil then
	print("Already in")
else
	mo = Instance.new("Model", Workspace)
	mo.Name = "MapsHere"
	print("MapsHere has been inserted")
end

while wait(5) do
	txt = prefix .. ": Preparing to insert a new map!"
	m = Instance.new("Message", Workspace)
	for i = 1, string.len(txt), 1 do
		m.Text = string.sub(txt,1,i-1) .. "" .. string.sub(txt,i,i)
		wait()
	end
	wait(2)
	m:Remove()
	maps = game.Lighting.Maps:GetChildren()
	num = math.random(1, #maps)
	for i = 1, #maps do
		if maps[i].Name == maps[num].Name then
			newmap = maps[i]:Clone()
			newmap.Parent = Workspace.MapsHere
			ntxt = prefix .. ": The map " .. newmap.Name .. " has been randomly chosen!"
			m2 = Instance.new("Message")
			m2.Parent = Workspace
			for i = 1, string.len(ntxt),1 do
				m2.Text = string.sub(ntxt,1,i-1) .. "" .. string.sub(ntxt,i,i)
				wait()
			wait(2)
			m2:Remove()
		while true do 
teleportHere = Vector3.new(-601.52, 750.27, -73.18) 

wait(22) 
local p = game.Players:getChildren() 
for i=1, #p do 
p[i].Character.Torso.CFrame = CFrame.new(teleportHere.x, teleportHere.y + ((1-i)*5), teleportHere.z) 
		
		end
	end
	wait(timer)
	getmaps = Workspace.MapsHere:GetChildren()
	for i = 1, #getmaps do
		getmaps[i]:Remove()
	end
	m3 = Instance.new("Message")
	m3.Parent = Workspace
	endtxt = prefix .. ": The current map has been removed, a new map will be picked shortly!"
	for i = 1, string.len(endtxt), 1 do
		m3.Text = string.sub(endtxt,1,i-1) .. "" .. string.sub(endtxt,i,i)
		wait()
	end
	wait(2)
	m3:Remove()
end
				

1 comment

0

You need a Screen GUI in the game before you can do anything to your script... e_e