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

[Solved] Problems with Remote Function Call order?

Client:

Mode is Normal

Difficulty is Easy

local RS = game:WaitForChild("ReplicatedStorage") 
local EV = game.ReplicatedStorage:WaitForChild("ServerEventHandeler")
local SC = game.ReplicatedStorage.ServerEventHandeler:WaitForChild("ServerCreation")
local LP = game.Players.LocalPlayer
local Dif = game.ReplicatedStorage.Settings.Difficulty.Value
local Modee = game.ReplicatedStorage.Settings.Mode.Value

script.Parent.MouseButton1Click:Connect(function()
    print("SC Waiting")
    SC:FireServer(LP ,Dif ,Modee)
	print("SC Fired")
end)

Server

local function lobby(LP ,Dif ,Modee)
	print("LP is", LP.Name)
	print("Dif", Dif)
	print("Mode", Modee)		
end

local SC = game.ReplicatedStorage.ServerEventHandeler:WaitForChild("ServerCreation")
SC.OnServerEvent:Connect(lobby)

The output is

LP is tommymcoco1

Dif tommymcoco1

Mode Easy

1 comment

0

Difficulty and Mode are both String values

1 answer

✓ Accepted answer

Remote functions automatically pass the player who invoked the function as first parameter.

local function lobby(LP,Dif ,Modee)
    print("\"LP\" is", LP)
    print("Dif", Dif)
    print("Mode", Modee)        
end

And for the client you just don't pass it:

SC:FireServer(Dif ,Modee)

In your case the LP parameter was player passed by the remote function, Dif was player passed by you and Mode was Dif parameter passed by you on client, the fourth parameter was the actual Modee but it got ignored.

1 comment

0

Thank you

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