Nothing happens when I fire remote to all clients to play tweens on server

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to play my tweens that make my camera zoom in and make the transition frame background to 0 using tween then call the SetupGame function
    and then make my camera zoom out and make the transition frame background to 1 using tween. It is like a transition.

  2. What is the issue? The issue is that nothing happens when I :FireAllClients() from server to the client using my transition remote in the Remotes folder in ReplicatedStorage. The remote did fire from server to client and the tweens did play but nothing appear and happenes on my screen when I played the game.

  1. What solutions have you tried so far? I have tried to add some debugs, check my GUI visibility, and also asking for some helps but no one helps me.

Server code:

while IsMatchValue.Value == true or IsIntermissionValue.Value == true do
	if PlayersInGame >= RequiredPlayersToStart.Value then
		if IsIntermissionValue.Value == true then
			
			if CanSetIntermission == true then
				CanSetIntermission = false
				CanSetMatch = true
				TimeLeftValue.Value = IntermissionTimeValue.Value
			end
			
		elseif IsMatchValue.Value == true then
			
			if CanSetMatch == true then
				CanSetMatch = false
				CanSetIntermission = true
				TimeLeftValue.Value = MatchTimeValue.Value
			end
			
		end
		
		task.wait(1)
		
		if TimeLeftValue.Value > 0 then
			TimeLeftValue.Value -= 1
		else
			warn(OutputMark..'TimeLeftValue value is not greater than 0 to countdown!!')
		end
		
		if TimeLeftValue.Value <= EndTimeValue.Value then
			if IsMatchValue.Value == true then
				IsMatchValue.Value = false
				IsIntermissionValue.Value = true
				TransitionSignal:FireAllClients('transition_start', true)
				SetupGame('setup_intermission')
				TransitionSignal:FireAllClients('transition_end', true)
			elseif IsIntermissionValue.Value == true then
				IsIntermissionValue.Value = false
				IsMatchValue.Value = true
				TransitionSignal:FireAllClients('transition_start', true)
				SetupGame('setup_match')
				TransitionSignal:FireAllClients('transition_end', true)
			end
		end
		
	elseif PlayersInGame < RequiredPlayersToStart.Value then
		if IsMatchValue.Value == true then
			TransitionSignal:FireAllClients('transition_start', true)
			SetupGame('setup_intermission')
			TransitionSignal:FireAllClients('transition_end', false)
		end
	end
	task.wait()
end

Client code:

local Players = game:GetService('Players')
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local StarterGui = game:GetService('StarterGui')
local TweenService = game:GetService('TweenService')

local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild('PlayerGui') or Player.PlayerGui
local PlayerCamera = workspace.CurrentCamera

local Char = Player.Character or Player.CharacterAdded:Wait()

local TransitionUI = PlayerGui:WaitForChild('TransitionUI')
local TransitionFrame = TransitionUI:WaitForChild('TransitionFrame')

local ConfigurationsFolder = ReplicatedStorage:WaitForChild('Configurations')
local ModulesFolder = ReplicatedStorage:WaitForChild('Modules')
local RemotesFolder = ReplicatedStorage:WaitForChild('Remotes')

local TimeUtilityModule = require(ModulesFolder:WaitForChild('TimeUtilityModule'))

local TransitionSignal = RemotesFolder:WaitForChild('TransitionSignal')

local DisplayConfigs = ConfigurationsFolder:WaitForChild('DisplayConfigs')
local GameConfigs = ConfigurationsFolder:WaitForChild('GameConfigs')
local MatchConfigs = ConfigurationsFolder:WaitForChild('MatchConfigs')

local TimeLeftValue = DisplayConfigs:WaitForChild('TimeLeft')

local IsIntermissionValue = GameConfigs:WaitForChild('IsIntermission')
local IsMatchValue = GameConfigs:WaitForChild('IsMatch')

local ChosenTargetValue = MatchConfigs:WaitForChild('ChosenTarget')

local TransitionOpenInfo = TweenInfo.new(.35, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)
local TransitionCloseInfo = TweenInfo.new(.35, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0)

local TransitionOpenAnim = TweenService:Create(TransitionFrame, TransitionOpenInfo, {BackgroundTransparency = 0})
local TransitionCloseAnim = TweenService:Create(TransitionFrame, TransitionCloseInfo, {BackgroundTransparency = 1})
local TransitionCameraOpen = TweenService:Create(PlayerCamera, TransitionOpenInfo, {FieldOfView = PlayerCamera.FieldOfView / 3})
local TransitionCameraClose = TweenService:Create(PlayerCamera, TransitionCloseInfo, {FieldOfView = PlayerCamera.FieldOfView / 3 * 3})

local Tracks = {TransitionOpenAnim, TransitionCameraOpen, TransitionCloseAnim, TransitionCameraClose}

local OutputMark ='[RoundSystemHandler (Client-Side)]: '

StarterGui:SetCore('ResetButtonCallback', false)

task.spawn(function()
	while task.wait() do
		if ChosenTargetValue and ChosenTargetValue.Value then
			if IsMatchValue.Value == true then
				if Player == ChosenTargetValue.Value then
					local Highlighter = Char:FindFirstChild('TargetHighlighter')
					if Highlighter and Highlighter:IsA('Highlight') then
						Highlighter:Destroy()
					end
				end
			end
		end
	end
end)

TransitionSignal.OnClientEvent:Connect(function(TransitionType: string, WaitUntilFinished: boolean)
	assert(type(WaitUntilFinished) == 'boolean', OutputMark..'WaitUntilFinished expect to be boolean but got '..type(WaitUntilFinished)..' instead!!')
	
	TransitionType = tostring(TransitionType)
	TransitionType = string.lower(TransitionType)
	--print(TransitionType)
	
	if TransitionType == 'transition_start' then
		--print('start transition')
		TransitionOpenAnim:Play()
		TransitionCameraOpen:Play()
	elseif TransitionType == 'transition_end' then
		--print('end transition')
		TransitionCloseAnim:Play()
		TransitionCameraClose:Play()
	else
		warn(OutputMark..'Invalid TransitionType when fire transition remote. Please check again!! -> TransitionType: '..tostring(TransitionType))
	end

	if WaitUntilFinished then
		
		for _, track in Tracks do
			track.Completed:Wait()
		end
	end
	--print('finished transition')
end)

Problem solved. I cannot yield tweens on client. I have to use task.wait() on the server when playing the tweens from client.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.