im trying to have a localscript attached to a UI thats trying to run a function to grab some data from a function, and it works perfectly - up until it actually invokes the server. both scripts seem to just stop, nothing having actually happened. here is the script:
the local script in the GUI:
local player = script.Parent.Parent.Parent.Parent
local RemoteDataPass = game:GetService("ReplicatedFirst"):WaitForChild("RemoteDataPass")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local requestedstats = {"Str","End","Agi","Fin","Int","Will"}
local SignalPart = ReplicatedStorage.SignalParts:WaitForChild(player.Name.."'s SignalPart")
local RequiredStats = {
Str = 0,
End = 0,
Agi = 0,
Fin = 0,
Int = 0,
Will = 0
}
print ("everything else finished")
RequiredStats = RemoteDataPass:InvokeServer(requestedstats)
print ("the script is done")
and the server script being invoked (With irrelevant script omitted)
--some variables
RemoteDataPass.OnServerInvoke = retrievestats
--some other script
function retrievestats (player,requestedstats)
print ("Script Invoked")
if player == localplayer then
print (localplayer.."'s Handler responding to request.")
for i = 1, #requestedstats do
local requestedstat = requestedstats[i]
ShuffleDictionary[requestedstat] = StatsDictionary[requestedstat]
end
return ShuffleDictionary
elseif player ~= localplayer then
print (localplayer.."'s Handler rejected request")
end
end
again, it just seems to brick itself. the print just before the invocation fires, then both scripts go dead. it never even invokes the function or even errors. just stops.
i feel like i run into these inexplicable errors every time i try to write some script. anytime i try to outhink whatever engine bug or untraceable script error i just run into three more. it is extremely discouraging. any and all advice would be greatly appreciated.

1 comment
the infinite script.Parent did get the player, but i wasnt aware of the other method. im using that now, thank you. as for the actual remote function, it didnt seem to change anything.