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
Do you want to make a vote system or just teleport a player if it clicks on a button or maybe something else?
i just want it to switch out when the player clicks a button and make it so only 1 player sees it at a time not teleport
Then just make a click event with the button:
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)
thank you for that! but how would i make it switch to the map and specifically the map i want?
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
Can you show me that folder and their children in the explorer?
this is my entire explorer for the game
Where is the folder you talked me about?
it would be called first office it has all the parts for the first map just not the skybox and lighting
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.
so how would i work if you don’t mind walking me through on what it will do? thanks a bunch too btw
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.
doesnt the game like arsenal delete the map but it’s stored somewhere in the files and can be restored?
Probably yes, but in this case that can’t be implemented, because we’re not teleporting every player to a certain place like a vote/round system
If what you’re trying to do is allow the vip server owner be able to change the map, you might be able to use a RemoteEvent.
When the owner clicks the button, fire the RemoteEvent.
On the server, detect when it is fired, ensure that the vip owner did it, and then do the code where it changes the map.
not a vip server commands a gui that pops out and on button click it changed the map for the client
uh if this helps explain do you know that game beat up simulator it was very popular a while back?
would it be easier if i made it a 1 player server instead?