Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[SOLVED] Arg in FireClient Request becoming nil?

Asked by
NewGPU 36
5 years ago
Edited by Gey4Jesus69 5 years ago

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)
1
Did you try ingame? RafaelFixe1 108 — 5y
0
Are you sure this is the same remote event that the server and client are using? FireyMcBlox 134 — 5y
0
please put [SOLVED] in your title in the future Gey4Jesus69 2705 — 5y

1 answer

Log in to vote
0
Answered by
NewGPU 36
5 years ago

Nevermind, solved.

Ad

Answer this question