Why is this remote function not affecting the client?
Asked by
6 years ago Edited 6 years ago
Here is the LocalScript:
01 | local repStorage = game:GetService( "ReplicatedStorage" ) |
02 | local eventsFunctions = repStorage:WaitForChild( "Events/Functions" ) |
03 | local neededFunction = eventsFunctions:FindFirstChild( "RemoteFunction" ) |
04 | local success, message = pcall ( function () |
05 | if neededFunction then |
06 | print ( "arrived at the event" ) |
07 | neededFunction.OnClientInvoke:Connect( function (box) |
09 | if box:IsA( "BasePart" ) then |
Here is the server script:
1 | local remoteFunction = game:GetService( "ReplicatedStorage" ):FindFirstChild( "Events/Functions" ).RemoteFunction |
3 | remoteFunction:InvokeClient(player, boxCopy) |
4 | awardBoxPrize(boxCopy, playerInfo, prize) |
Quick note: All the names and variable assignments are prototypes. This is not how I normally format things. Please refrain from commenting on that kind of stuff. It will be changed when I figure out how to make this work. Thanks!