Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[SOLVED] Arg in FireClient Request becoming nil?

Hello, I have an arg named Request that I really do need and it becomes nil when firing to the Client.

The script that fires:

workEvent:FireClient(player, "Enable")

The script that is the client:

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local workEvent = ReplicatedStorage:WaitForChild("WorkEvent")


workEvent.OnClientEvent:Connect(function(Request)
	print(Request)
	if(Request == "Enable") then
		print("Enable")
		Players.LocalPlayer.PlayerGui.Work.Enabled = true
	else
		if(Request == "Disable") then
			print("Disable")
			Players.LocalPlayer.PlayerGui.Work.Enabled = false
		end
	end
	
	if(Request:IsA("IntValue")) then
		if(Request > 1) then
			Players.LocalPlayer.PlayerGui.Work.WorkingTime = "Next Salary: "..Request.." seconds"
		else
			Players.LocalPlayer.PlayerGui.Work.WorkingTime = "Next Salary: "..Request.." second"
		end
	end
end)

3 comments

1

Did you try ingame?

0

Are you sure this is the same remote event that the server and client are using?

0

please put [SOLVED] in your title in the future

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.