Hers the script.

-- NOTE this works "Perfectly in studio but not in the real game currently..."
-- + my game is NOT filtering enabled And NOT in experimential Mode.


--Main is a Screen Gui in side of starter gui and in side the "Main" is a "GameBar"
--The "GameBar" is inside of Main.
--i made 3 maps and they are inside (Replicated Storge -> Maps -> "The 3 Maps [They are models])
--"Maps" is a folder in replicated Storage that contains the three maps i made.


function GetMap()--this function will get a random map from maps in replicatedStorage
	local Maps = game.ReplicatedStorage.Maps:GetChildren()--i have three maps in replicatedstorage
	local selectm = math.random(1, #Maps)
	local selm = Maps[selectm]:Clone()
	selm.Parent = game.Workspace.CurrentMap--"CurrentMap" is a folder in side Workspace that will contain on of
	--the maps from replicatedstorage.
end

function RemoveMap()--to take the map out!
	local REmap = game.Workspace.CurrentMap:GetChildren()
	local REselectm = math.random(1, #REmap)
local REselm = REmap[REselectm]:remove()
end

function chagt(text)-- "chagt" means "ChangeText" .I really want THIS To work "In the REAL Game!!!"
	--but when i join the game the words on the bar doesnt pop up...   :(
	--and when i check the dev console it says     attempt to index feild LocalPlayer   (Nil Value)
game.Players.LocalPlayer.PlayerGui.Main.GameBar.Text = text
end

-- game (note this is only about 20% of the script...)im not done yet    
 while true do
wait(2) 
chagt("Changing map...")

wait(3)   
chagt("The Map is Here! Just Run around and Have Fun!")
GetMap()


wait(5)
chagt("well no one won because this isnt the full game.... yet...")
RemoveMap()
end


6 comments

0

Game Bar is a text Label.

0

If your game is not experimental mode, that's the equivalent of it being in FilteringEnabled, but then it's not in FilteringEnabled. What game type is it?

0

Also, line 22 should be :Destroy(), not :remove().

0

Mini-Game are mostly 'Script's , and your method 'chagt()' contains 'LocalPlayer' which only works in LocalScript

0

HMM

0

Also, make sure this code is inside of a LocalScript not a normal Script