Here's something I threw together that seems to work for this. So, the call actually has to be made from a local script, and as long as that local script's function only runs for the specific player that you want then it should work. The way I did this was by having a script in the part that gets touched, a remote event that the script and the local script can access, and a local script. The script detects the hit, and then works out which player it needs to fire the remote event for. The local script waits until it gets fired(which only happens for the specific player's version of the local script) and then toggles the reset thing.
Script code:
01 | local event = game:GetService( "ReplicatedStorage" ).RemoteEvent |
03 | script.Parent.Touched:Connect( function (hit) |
04 | if debounce = = false then |
06 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
07 | local player = game:GetService( "Players" ):GetPlayerFromCharacter(hit.Parent) |
08 | event:FireClient(player) |
Local script:
01 | local gui = game:GetService( "StarterGui" ) |
05 | if reset = = false then |
06 | gui:SetCore( "ResetButtonCallback" , false ) |
09 | gui:SetCore( "ResetButtonCallback" , true ) |
15 | game:GetService( "ReplicatedStorage" ).RemoteEvent.OnClientEvent:Connect(ToggleReset) |