- What do I want to achieve?
Pretty simple issue. For some reason my remote events are passing the player argument twice? I was under the impression that the FireServer() method automatically passed the player as an argument, so I am unsure as to why the argument itself is being passed twice.
- What is the Issue?
The player argument is being passed twice.
LocalScript:
guidePrompt.Triggered:Connect(function(player)
currentCam.CameraType = Enum.CameraType.Scriptable
promptModule.moveCameraToGuide(localPlayer, currentCam, workspace.CameraParts.QuestGiver1Part.Position, workspace.Guide.Head.Position)
guideDialogueEvent:FireServer(player, "GuideDialogue", "test")
end)
Corresponding ServerScript:
guideDialogueEvent.OnServerEvent:Connect(function(one, two, three)
print(one) -- this prints the player
print(two) -- this also prints the player
print(three) -- this prints "GuideDialogue"
end)
I also tried this variation in my ServerScript:
local function startDialogue(player, two, three)
print(player) -- prints player
print(two) -- prints player
print(three) -- prints "GuideDialogue"
end
guideDialogueEvent.OnServerEvent:Connect(startDialogue)
- What solutions have I tried thus far?
My best guess was that the fact that the remote event is tied to a proximity prompt, which also passes the player as an argument, is probably somehow interfering with the FireServer() method. However, I have been unable to confirm whether or not that is the issue, and no other variations I tried have worked.
Thanks in advance.