Hello all, I’ve encountered an issue that I’ve spent an hour trying to find and resolve. It appears either A, the given remote event isn’t firing to the server or B, The server isn’t recognizing the remote event firing. Option A seems highly unlikely since I have extensively tested every parameter and if statement to make sure everything is correct. The Local Script functions as designed. So, either the server script appears to not pickup on the fired event or the event isn’t being fired. No errors are being thrown. The Server script is in ServerScript Service, the Remote event is in a folder thats in ReplicatedStorage, The Local script is within a GUI in StarterGui. None of the prints within the server script will fire.
I don’t know if this is gonna work but try changing RS.Shared.Remotes.ATMEvent to RS:WaitForChild("Shared"):FindFirstChild("Remotes"):FindFirstChild("ATMEvent")
on both scripts.
Hey, you did it incorrect in the server script. You should describe there your variables. That’s how the script would look like:
local proxService = game:GetService("ProximityPromptService")
local proximity = script.Parent.Proximity.Attachment.ProximityPrompt
local RS = game:GetService("ReplicatedStorage")
local CurrencyName = RS.Shared.Settings.CurrencyName.Value
local CurrencyName2 = RS.Shared.Settings.CurrencyName2.Value
local ATMEvent = RS.Shared.Remotes.ATMEvent
ATMEvent.OnServerEvent:Connect(function(player, terminalMode, terminalNum)
print("Relayed")
print(player.Name)
print(terminalMode)
print(terminalAmount)
-- Continue script here
end)
And here explain why this:
When you have fired server with these variables, you need to tell the server which variables it should read. Remote Event doesn’t have constant variables, you give them to it.
Thank you for that suggestion, I had already tried that though. Variables will still pass whether the function is separate or connected. (From what ive tested).
Thank you for this, Whenever I went to go try this I realized what was causing the problems, It was 2 variables that I no longer needed that stuck the script. I also recognized a few more mistakes I made. Turns out scripting at 1 AM is not a good idea.