Hello, devs! I’m sorry if this problem is really easy, I’ve tried a lot to fix it but it doesn’t work!
What do you want to achieve? For my upcoming game, there are going to be multiple jobs the player can join.
What is the issue? In my script, I’m passing a variable via a remoteFunction. But when the variable is getting sent from the clinet to the server the variable value voids.
What solutions have you tried so far? I’ve rewritten the entire job system, I’ve deleted all the scripts and re-did the whole code. But it still doesn’t work.
local function process_JobRequest(player, requestedJob)
local working = player:FindFirstChild("JobName")
local success
print("LINE 37 - " .. requestedJob)
if(working.Value == "" or working.Value == " ") then
if requestedJob.Value == "CafeJob" then
working.Value = "CafeJob"
player.TeamColor = BrickColor.new("Really red")
success = true
joinedJobModule.setup_Parameters(player)
return success
elseif requestedJob.Value == "Sunset Cleaning" then
working.Value = "SunsetCleaning"
player.TeamColor = BrickColor.new("Dark green")
success = true
joinedJobModule.setup_Parameters(player)
return success
elseif requestedJob.Value == "Sunset Lifeguard" then
working.Value = "SunsetLifeguard"
player.TeamColor = BrickColor.new("New Yeller")
success = true
joinedJobModule.setup_Parameters(player)
return success
else
print("ERROR Line 70 - " .. requestedJob)
success = false
return success
end
else
print("ERROR - " .. player.Name .. " is currently working at another job!")
success = false
return success
end
end
request_JoinJob.OnServerInvoke = process_JobRequest
Server script, that is picking up the remoteFunction
joinBtn.Activated:Connect(function()
joinJob_Close()
local jobRequest = request_JoinJob:InvokeServer(requestedJob)
if jobRequest == true then
update_JobInfo(requestedJob)
openInfo = true
open_jobInfo()
updateJobData:FireServer()
local working = player:FindFirstChild("JobName")
if working.Value == "CafeStaff" then
elseif working.Value == "SunsetCleaning" then
end
elseif jobRequest == false then
print("Picked up Server Error")
end
end)
localScript where the remoteFunction is Invoked.
14:43:33.926 LINE 37 - NoJob - Server - JobHandler:37
14:43:33.926 ERROR Line 70 - NoJob - Server - JobHandler:72
14:43:33.953 Picked up Server Error - Client - JobGuisHandler:213
Output ^^
The Cafe Staff part works, but the Sunset Cleaning (Which is the exact same code, but a tiny bit different) doesn’t work! Thanks, in advance.