![]() ![]() Great! Now let’s go to our Script in ServerScriptService and code two events. :Connect(function(player) - When the player joins the game do this MenuButton.MouseButton1Click:Connect(function() - When the player clicks the menu button. RemoteEvent:FireServer(BrickColor.new(Police)) RemoteEvent:FireServer(BrickColor.new(Prisoner))į1Click:Connect(function()- When the player clicks the Police team so Change team 1Click:Connect(function() - When the player clicks the Prisoner team so Change team It’s time to use the functions and variables we created. MenuButton.Visible = not menuButton.Visible ![]() let’s add some functions: local function TeamChoose() ![]() Local Prisoner = "Deep orange" - Prisoner team color it should the color of your team Local Police = "Really blue" - Police team color it should the color of your team Local blur = Instance.new("BlurEffect") - Create a blur effectīlur.Parent = game:GetService("Lighting") Local frame = script.Parent:WaitForChild("Frame") -Frame that is where our buttons areįrame.Visible = false - Make the frame invisible Local menuButton = script.Parent:WaitForChild("ChangeTeam") - Menu So first let’s make some variables in our local script (It is in our ScreenGui). Note: It is important to rename them exactly like this otherwise the script will not recognise these events. Rename one remote event to “ChangeTeam” and the second to “PlayerEnter”. Add a script in ServerScriptService and delete the code inside and then add two remote events in ReplicatedStorage. 5.Rename your buttons to Police and PrisonerĪdd a LocalScript to your screenGui (Not in the frame) and delete the code inside it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |