How To Implement This "Deploy" Local Script?

I’ve been struggling to make a “deploy” round system with the player ability to join ongoing match when it started before joining to the experience and etc. Is there any way for “everything for the player” to work only when there’s ongoing match?

I appreciate any help provided!

script.Parent.PlayButton.MouseButton1Click:Connect(function()
	if Process == true then return end --not important
	Process = true --not important
	
	-- this works when there's no ongoing match
	rs.Deny.OnClientEvent:Connect(function(plr) 
		script.Parent.Warning.Visible = true
		task.wait(3)
		script.Parent.Warning.Visible = false
	end)
	
    --some server things
	rs.RemoteEvents.PlayPressed:FireServer(Player)
	
	Click:Play() --not important
	Black:Play() --not important
	wait(0.5) --not important

	
	
	--[[everything for the player (intended to work when there's ongoing match,
idk how to do that right:( )]]
	script.Parent.PlayButton.Visible = false
	script.Parent.SettingsFrame.Visible = false
	script.Parent.CreditsFrame.Visible = false
	script.Parent.SettingsButton.Visible = false
	script.Parent.CreditsButton.Visible = false
	script.Parent.ShopButton.Visible = false
	script.Parent.ShopFrame.Visible = false
	
	script.Parent.Parent.LoadoutGui.Indicator.Visible = true
	script.Parent.Parent.LoadoutGui.Loadout.Visible = false
	script.Parent.Parent.LoadoutGui.ToggleLoadoutGui.Visible = false
	
	script.Parent:WaitForChild("GameMusic").Playing = false
	
	--camera
	task.wait(0.1)
	Camera.CameraType = Enum.CameraType.Custom
	Camera.CameraSubject = Player.Character.Humanoid
	
	
	UnBlack:Play() --not important
	Process = false --not important
end)
1 Like

How are you tracking if the match is active?

Maybe add a BoolValue to Replicated Storage. Update it with your Match script.

That way this script can check if the match is Active by checking if the bool is true or false.

Example;

local rs = game:GetService("ReplicatedStorage")
local match_active = rs:WaitForChild("Match_Active") -- BoolValue on Replicated Storage


if match_active.Value == true then
	
	-- do stuff
	
else
	
	-- do this stuff instead
	
end
2 Likes

it doesn’t work properly with bool values, when a new player joins a game, the bool value is false on client even if its true on the server in ReplicatedStorage. Maybe I need to put it somewhere else?

1 Like

Use a Remote Event to check the status of the bool.

Here is an example:

status.rbxl (54.6 KB)

Make sure your Output window is visible so you can see the printout.

2 Likes

I’ll try that, hope this will work for me. Thanks in advance!