hello robloxians I’m making some more additions to my game and I want to make a gui to change into infinite different maps as many as I cant make and add but, I cant seem to figure out where to find a tutorial or any help so I’m coming here for help.
I’ve organized my map here is what my area looks like
I’ve made all the possible areas I want it to appear but I’m determining on where mainly the top where its circles
ik this isn’t much and I’m sorry but I really don’t know what I’m doing in this territory of game development
You might be able to store the other maps somewhere else, (preferably ServerStorage) and then when the round is over, delete the current map, and then clone the new map from ServerStorage
Have a model containing the map in workspace, e.g. “MapContainer”
In ServerStorage, there would be a folder named “Maps”, in that folder contains a bunch of models, each one corresponding to a map.
When the round ends, call ClearChildren on MapContainer and then randomly pick and Clone a map from ServerStorage.Maps and Parent it to workspace.MapContainer.
very sorry for the late response but how would i make it sync to a button click on a gui? as many times as i want would i be in separate scripts? idk sorry
local Players = game:GetService("Players")
local Client = Players.LocalPlayer
repeat wait()
until Client.Character -- I make this because CharacterAdded isn't working anymore
local Character = Client.Character
local Button = script.Parent
local PartToTeleport = workspace.Part -- Put here the explorer location of the part you want to teleport to
Button.MouseButton1Click:Connect(function()
Character:SetPrimaryPartCFrame(PartToTeleport.CFrame)
end)
Make a part inside the workspace with the position you want to teleport to and name it something like “Map2Spawn” whatever your name is put it at the end of this variable
does that keep the map clean like change just the objects with some new ones and change the skybox cause i made a folder for the selected parts i want to go away and come back
Oh alright, inside the folder put a Part with the position you want the player to go, name it Reference and then just edit the script like this:
local Players = game:GetService("Players")
local Client = Players.LocalPlayer
repeat wait()
until Client.Character -- I make this because CharacterAdded isn't working anymore
local Character = Client.Character
local Button = script.Parent
local PartToTeleport = workspace["first office"].Reference
Button.MouseButton1Click:Connect(function()
Character:PivotTo(PartToTeleport.CFrame)
end)
And that would be it for that map, you can do the same with the rest of them by just editing the “PartToTeleport” variable with the name of the folder.
Sure, first you’re getting the player and its character, so you know it is a LocalScript. Then you make 2 variables which localize the button that gets clicked and localize the part on where player needs to get teleported. And lastly we make a function which will trigger when the button it’s clicked and will make the player’s character teleport to the part.